The After Effects team recommends using Adobe Media Encoder for H.264 export. Here Rick Gerard explains why:
"In every version of AE that has been capable of exporting h.264 the quality has been significantly lower than exporting with an app that gives you the option of multi-pass rendering. This has always been true for MPEG codecs that use inter frame (temporal) compression. You just can't get the same quality without multi pass compression. This goes back to the first use of MPEG streams. AE CS6 may have H.264 encoding broken internally, but any pro has never used AE to render highly compressed delivery codecs because AE was never designed to be the right tool for the job."
Also, you can drag and drop the project file itself into AME, but it takes time because Dynamic Link has to identify all the comps in your project and you can only select one at a time to load. Instead, simply shift click all the comps you want to render in the After Effects Project Panel and drag and drop them into AME all at once. Then you can add as many presets or custom presets to each comp as you want.
Also, to save yourself time setting the Source Range to Work Area for each comp in AME you can just right click the work area bar in After Effects and select Trim Comp to Work Area before dragging your comps over.