I am working on that although my “no freaking idea of how to train a dog”, ex has a 6 month head start on me.
Briefly…. Put dog inside crate only large enough for it to ly comfortably. Only take dog out of crate to pee and poop. A dog can hold its ***** one hour for every month of age. A dog normally poops 20 minutes after eating. When taken out, take to same place and when dog relives itself, in a high voice, say wiz, or poop. When dog is finished, reward. Pet dogs like food, working dogs, like to play tug. After about a month, dog will **** and poop on command. During crate training, never play with dog inside house, only play outside. Bonus, take dog outside the same route every time. In other words, the same sliding glass door. Take him to the exact same place in your backyard. That way, he will only poop in the same area. Structure is key. Same thing every time!