I'm certain dogs can sense when they are 'home' with a new family or owner. Many people have said they felt that way when they got them home.
You're spot on.
He got excited when we went to see him as the lady at the rescue home pointed out when had a bit of a wee.
Once he had his new forever home there was never a problem