Using the potty at night

I need help! My son has been potty trained for a while now. Unfortunately, I started putting pull ups on him at night time so I’ve just started letting him sleep in underwear. Some nights, he doesn’t pee at all.. but some nights, he pees everywhere! How do I get him to learn how to wake himself up? It’s as if laying in pee doesn’t even bother him. He’ll wake up & go on about his day.