How does my dog think?
Dog’s live in the moment and are unable to make connections between a past behavior and owner’s current response.
A dog’s train of thought during the day is very simple:
Dog things -> More dog things -> need to pee -> pee on the rug -> more dog stuff -> wow I am a dog -> omg I am a dog -> owner is here -> yelling and pointing -> sad dog : The only thing that the dog learned is that he is sad when the owner comes home.
He is not able to see that you are upset because of something that he did earlier.
Which is why its important to make corrections during the event and not wait too long. The dog just does not have the capacity to understand that the owners reaction is about peeing on the rug, that happened hours ago and not the owner coming home and seeing the dog.