I forgot to add: never put your dog in the x-pen without taking him out to go potty first and when you take him out of the x-pen, same thing, outside to go potty.
You have to establish new good habits and help him forget the old bad ones. So it's potty all the time, potty all the time

(outside that is)