after wiping/removing the poo or pee, spray the area with lysol. then provide a training pad/poo pad so they will know to do their business there. you can also buy "puppy trainer" its a liquid you can drop in the area where you want them to do their business. it is an attractant so they know to do it there. when they poo/pee in the right place, praise them and when they don't say no but don't hit them. eventually, the will learn. but it takes a lot of time and patience
also, it helps if you bring your dogs outside after eating. wait for them to do their business in the garden before bringing them back in the house.