Format and codec are two very different things and you need to learn the difference between them. A format (AVI, MOV, etc.) is a container for a codec. H.264, Animation, PNG are all examples of a codec that you find inside the container.
For most online applications h.264 is the right choice for a codec. It may be in an FLV container, or an MP4 container, or something else (depending on playback), but h.264 is the majority of online HD content.
In any case, you shouldn't make it with After Effects. Render an intermediate file out of AE and then use the Adobe Media Encoder to make your final file.
A good intermediate file format and codec would be Quicktime with the Photo-JPEG codec. Another good option is Avid's DNxHD codec.
yea yea i know the difference, just i don't know how to write in english, so is correct to say "container"
btw is there a pdf that explain all these things? which format is good for what etc maybe for internet, for personal use etc etc, a complete pdf that explain roughly everything about container and codec
There are too many variables to really be able to explain things in a quick, concise manner. Wikipedia has a number of good articles on compression and such things even if they do get a bit overly technical. Basically, the most common output for HD content is H.264 and unless there is some kind of odd circumstance that would be the codec I would use for my final work.