How do I encode videos into h.264 at 8k resolution?
Are you sure the 8k videos on your computer are actually h.264, and not h.265?  The max resolution of h.264 level 5.2 is still 4096x2305.  To convert beyond that in Premiere, you need to chose HEVC (h.265) as the format in the export settings dialog.  The HEVC stands for High Efficiency Video Coding, and you might have that confused with "advanced video encoding."  H.265 supports up to 8192×4320.  Upscaling your 4k in Premiere shouldn't be a problem, either.  I'd do it by changing the project settings to my desired resolution, then scaling the timeline video to fit, but you could probably also do it in the export settings dialog.