I wouldn't use crate as a punishment. If he's been pooping right after he comes inside from just pooping... why don't you just stay outside longer, OR when you bring him back inside put him in his crate (not as a punishment - just so he doesn't go in the house). or have him on a leash while you're inside so you can keep your eye on him 24/7. Don't let him out of your sight! Too much freedom at too young of an age! Set him up for success! That's what I did w/ Jackson. He had his accidents of course but I set up him up for success by not allowing him out of my sight when he was not confined. I was very diligent and if he didn't go outside, it was back in the crate for another 20 minutes, then we'd go try again. He would get 30 mins of playtime after coming inside in the mornings but I was watching him 24/7. if you can't keep your eye on them, they need to be confined

I learned this when I had Jackson in my bedroom as a pup, I literally looked down at my phone for maybe 10 seconds to read a text, looked up.. and was peeing on the floor!