when he does it again and the same with urinating. tell him NO then grab his neck take him to the spot where he pooped or peed and then push his face down like ur gonna rub it on it(dont actually rub his face in it) and at the same time tell him "NO!!" and then slap him on the head or nose (not too hard)just enough so he gets the picture and then maybe after a couple times doing that he should start scratching on ur door telling u to let him out. thats what i did with my dog. but the bad thing is that she scratched up my door!!