I would suggest the xpen with the open crate and potty pads inside the crate too. My pup was doing the same thing for a while and I tried this and he has stopped pooping in his crate. Also, I keep him beside my bed at night and he will whine if he needs to go out

BTW, he's back to sleeping in a crate now. I agree with the OP that taking him out in the middle of the night might help too.