Pets acting out

Li
My vet feels that my dog is constantly going to the bathroom in our house because he senses change and is stressed, so he is acting out. Does anyone have any advice on how to handle this? Im losing my patience with him and am tired of bending my big self on the floor to clean it up daily. 😤