i am taking a dog.i want to know how to train the dog?(german shepherd)?

my dog is 2 months old.how do i do his poop training.basically how should i prevent him from pooping and pissing in the house.please i need specific answers.also,are there any tools or just anything.i just want that he shouldnt make the house dirty.
waiting for your answers.