I have a 7 month old puppy myself, I don’t currently have this problem but I understand the frustration, when I first had my puppy I had a similar problem, does he normally poop shortly after eating? Could you feed him outside and keep him out with you in the garden say for a bit longer so he can’t poop inside? Maybe he’s a little scared outside. I’m really no expert but just wanted to offer you something. If you can keep any tract of when he might poop, like post playing or something I would get him outside and keep him there till he goes. It’s very hard some times so hang in there! He will get it, I stood outside for hours and hours in the beginning because mine just wouldn’t go outside but they get it in the end.