if you live in house with small garden, well depends on how small the garden is, dog can pee poo there.
We had garden size enough for dog job.
if that no possible, what most do is take dog for walk with a dog leash.
on the way on suitable places dog will pee and poo.
I see people do this...