he’s leaving Thailand. His flight is at 2 am. International check in opens three hours ahead of flight departure. Check in, drop bags, get boarding pass, go to immigration. That’s how he does it.
Just get through immigration before midnight on the 7th and don’t use the auto gates to leave….get your passport you’re stamped out by an immigration officer.