Good question and something I had lots of problems with.
I bought a cheap puppy pen, which worked for a few days then he figured out that he could move the thing across the floor. So I had to tie the thing down which worked fine. Then he figured out that he could use his water bowl as a step if he tipped it over. I had it all on camera, he literally knocked it over and pushed it to the edge and scrambled over the bars
he then ran around the house causing chaos
So I then had to create a roof for the pen, it was a nightmare
I think mine was a rare occurrence as my friends puppies didn't do this.
If I were buying one now, I would look at as big pen as possible and all tall sides.
Good luck