In addition to the excellent advice given above, if you see him peeing or pooping inside, interrupt him (even just a verbal “hey! don’t do that” or maybe a clap etc), then whisk him outside to finish...