When he was alive and wanted to go pee, he would stand y the glass door to the backyard and sometimes scratched the door to make sound; we would open the door to let him to go out to pee.
You have to train your dog. When he pees in the wrong place, raise your voice to tell him (maybe slightly hit him) he knows.