You don't. That's up to nature. At 12-weeks, it's just too soon to expect him to hold it. Our two boys will be 16 weeks old this week and we have just had our first "accident-free" week. That said, I by no means expect them to be able to hold it, especially during active play inside. Every 30 minutes sounds about right. What you have to watch is that when you take him out that you do not play before or after peeing or he will learn to expect that and he will constantly go to the door to play rather than pee. It will frustrate you and prolong the training.
After every meal or drink, take them out. Give him some unique word or phrase like "make pee-pee" or "go potty", just make sure it's nothing that will embarrass you if the neighbor's overhear.

If he goes praise him profusely and bring him back in. If after a few minutes he doesn't go, bring him back in, but don't criticize or punish for not going.
You might have instances where you take him out and he does nothing, but as soon as you bring him back in he has an accident. If you catch him in the act, then you give him an authoritative "no" and take him out. If you don't see him do it, but find a puddle, just clean it up and ignore it. Yelling after the fact will only confuse him. Make sure you clean it well, because they will teach themselves that anything that smells like pee is a potty place. We use white vinegar. It doesn't completely remove the pee scent, but it does a good job and the vinegar smell seems to get the message across.
We've had pups who just one day "get it" and that was it for accidents. They still have to go out more frequently, but they will go to the door and bark or whine and hold it until you get there. Other pups takes longer with accidents becoming less and less frequent.
As Tabitha said, be patient.