Routing of spark plug wires on 2001 Hyundai XG300

Changing plugs and wires on 2001 Hyundai XG300 my grandson bought. Not sure wires were connected properly when he purchased the car. Did not run worth a darn.
What is the cylinder layout? Which coil does each wire from rear cylinders connect to?

I don't have a diagram on your engine but if it's like the 2.5L or 2.7L engines it 1-3-5 on the rear bank and 2-4-6 on the front. The firing order for those is 1,2,3,4,5,6. The ign coil pack, from front to back goes 1,4,5,2,3,6 for those motors. Yours may be the same.
You could check on some online manuals for the info that you need or you could tow it to a Hyundai or Mitsubishi specialist.
Here are two data sources for you:
For AllData:
http://bit.ly/AllData_Repair_Manuals_Online
Here's the one for Mitchell as well:
http://bit.ly/mitchell_repair_manuals_online
If you want to find a specialist, here's a directory link for you:
https://repairpal.com/directory?address=43017&car_brand_names=Hyundai