For the first case here are the different combinations for two children based on sex (let's say left denotes older and right denotes younger to distinguish the difference between girl and a boy and boy and a girl.)
B B
B G
G B
G G
These outcomes are each equally likely, but since we know that one has to be a boy we can eliminate the (G G) case leaving us with two chances out of three that the other child is a girl.
The other case can be viewed as follows (S) denotes seen.
B(S) B
B B(S)
B(S) G
B G(S)
G(S) B
G B(S)
G(S) G
G G(S)
I can eliminate all cases where I see a girl out the window, leaving me with the following equally likely cases:
The neighbor has two boys and I see the older boy. The neighbor has two boys and I see the younger boy. The neighbor has an older boy whom I saw and younger girl. The neighbor has an older girl and a younger boy whom I saw. The neighbor has a girl in 50% of the remaining possible cases.