You need to use the Composition --> Send to Adobe Media Encoder Command to render H.264.
After Effects has never been very good at creating H.264 video. It is better to render to a high-quality codec like Cineform, DNxHD, or Quicktime with the PNG codec and then use the Adobe Media Encoder to make your H.264 file. Or, if you prefer, just put your After Effects composition in the Adobe Media Encoder to make the h.264 and do not bother with rendering in After Effects at all.
The Adobe Media Encoder can do multipass encoding and After Effects can not.
That is why the Adobe team took the option to render as an h.264 out of After Effects. However, you can put it back in by going into the preferences.
Thanks, that's it!
I will keep in mind. Thank you very much!