I've made a video on After Effects cs6 (Trial Version), but I can't find the correct rendering format that I want (H.264).
Please look at this screenshot:
Enable the respective option in the preferences.
That is not a screenshot of After Effects CS6. That is a later version.
To create H.264 files, use Adobe Media Encoder.