Video codec/video file format confusion in Blender
Number 1 is a selector to guide you in your next step for movie encoding selection. It can make the encoding section disappear or take other options. It's more a selector for whether you want an encoded movie or a selection of images, and blender gives you the right section. It's ignored for your output movie file.

Number 2 is your container, and 3 is your codec.

That said, let's examine your output:

1) Correct. "MPEG-4" and "H.264" must give MP4, being MPEG-4 the container. I think its your best option for your YouTube uploads.

2) Correct. If you choose MPEG or H264 for number 1, you will continue getting the same (AVI). Like I said , number 1 has no impact on your results. Here you will always get an AVI if you choose a container like H264. This is more a Blender behavior. (I expected an MP4, too.) Blender uses H264 like a container and doesn't let you choose a codec, exchanging it for a lossless option. I remember having read that Blender is very oriented towards H264 as a final output file, so I think that explains the special behavior for this option.

3) Correct. Like 1), you will get a .mov container and codec of your choosing.