Someone asked me to post a photo of Kodi's ex-pen set-up when he was a puppy. So here it is. Please remember that he came form his breeder already well trained on the use of the litter box, so he had almost no accidents in the ex-pen set up this way. The few mistake he had were during a period where he would get his FRONT feet in the box, but not his back feet. We solved that problem by pushing the litter away from the front edge of the box, so he had to walk all the way in to get his front feet on the litter!
If the puppy doesn't already know to use the litter box, you will have to start with it closed down to JUST a sleeping area on one side, and the litter box (or other potty option) on the other side. Very few puppies who have been raised properly will willingly soil their bed, so they HAVE to use the potty to eliminate.
Over time, you give them a little more space, then a little more, as they show their ability to still use the potty. You want them to be as close to error-free as possible. If they make a mistake, close it back down to the last size that they were successful for a while again.
Oh, and when he was REALLY little, we had a much smaller crate actually inside the pen with him. When he was trustworthy with the potty, we added the bigger crate to the outside to give him more room. He continued to use this set-up at night and when we were out of the house until he was about 2 1/2.
I'm not one to think that dogs should have free run of the house when I'm not home. Even if they are completely reliable in terms of pottying, there are just too many dangers in any house for a bored, unsupervised dog. So Kodi is confined to my office with a baby gate if we are away for a long time during the day. He has his litter box, water and his crate, as well as access to the couch in there, so it's basically a larger version of the ex-pen arrangement... I just don't need to worry about my oriental rug or the couch anymore!
For shorter periods, he just goes into his crate. (he's quite happy with this)
(oh, and yes, that B&W thing in the back of the crate is him, on his back, flopped out and napping!