Composition -> Add to render queue -> Click on the "Output module" -> In format choose Quicktime Movie -> Click on the format options (pop up will open) -> and in compression type choose h.264!
I hope it helped.
i know that but when i select h.264 it says
After Effects : For rfeliable output with H.264 compression, please choose it directlly from the Output Module Format menu instead of via QuickTime
(44 : 81)
There is one option below Add Render to Que button but i have not been able to select that