How to manually sign a transaction with multiple inputs and multiple outputs?
When it comes to transactions, I think that a hex representation can explain more unambigiously than words.
That's why my answer uses hex along every step of the signature.
Given your P2PKH transaction with two inputs, here's the raw transaction that has to be signed with the private key corresponding to the first outpoint:
01000000
02
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
00000000
19
76a914&lt;your-first-pkhash(160bit)&gt;88ac
ffffffff
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
01000000
00
ffffffff
02
a086010000000000
19
76a914&lt;hash-of-target-btc-pubkey1(160bit)&gt;88ac
50c3000000000000
19
76a914&lt;hash-of-target-btc-pubkey2(160bit)&gt;88ac
00000000
01000000

Here's the raw transaction that has to be signed with the private key corresponding to the second outpoint:
01000000
02
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
00000000
00
ffffffff
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
01000000
19
76a914&lt;your-second-pkhash(160bit)&gt;88ac
ffffffff
02
a086010000000000
19
76a914&lt;hash-of-target-btc-pubkey1(160bit)&gt;88ac
50c3000000000000
19
76a914&lt;hash-of-target-btc-pubkey2(160bit)&gt;88ac
00000000
01000000

And here is the resulting signed transaction:
01000000
02
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
00000000
6a
47
304&lt;...rest-of-signature&gt;
01
21
&lt;your-first-pk(264bit)&gt;
ffffffff
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
01000000
6a
47
304&lt;...rest-of-signature&gt;
01
21
&lt;your-second-pk(264bit)&gt;
ffffffff
02
a086010000000000
19
76a914&lt;hash-of-target-btc-pubkey1(160bit)&gt;88ac
50c3000000000000
19
76a914&lt;hash-of-target-btc-pubkey2(160bit)&gt;88ac
00000000

Assumptions: (1) You're using compressed public keys. (2) type is SIG_ALL
Note: Length of signatures can vary, and as a result the bytes that indicate script length can differ from the example above.

Answering your 3rd question, there is a description here