Why does my pet...?
Why does my dog wait by the door when I'm out?
Short answer: Dogs form strong attachment bonds with their people, and many learn the sounds and routines that come before you get home. In one study, dogs greeted their owners more intensely after longer absences. A controlled test of the idea that dogs sense when you set off home did not find evidence for it.
Updated

In more detail
A controlled test of the idea that dogs sense when you set off home did not find evidence for it.
The wild side
The famous Akita Hachiko kept returning to Shibuya Station for almost ten years.
Try this
Keep comings and goings calm and predictable.
Explore a different dog question
For a different topic, read the dog-gaze research summary in six other dog habits, free to read on this page. It is not a test of whether your dog knows your return time or a measure of attachment. Waiting and Hachiko are not among the six habits. No email or purchase is needed to read the answers. Printing the free Letter or A4 mini-poster is optional.
See it in the episode
This Dog Waited at a Train Station for Almost 10 Years (Case Files, episode 4)
Questions people ask
Why does my dog wait by the door when I'm out?
Dogs form strong attachment bonds with their people, and many learn the sounds and routines that come before you get home. In one study, dogs greeted their owners more intensely after longer absences. A controlled test of the idea that dogs sense when you set off home did not find evidence for it. If your dog seems distressed when left alone (howling, damage, not eating), ask your vet or a qualified behaviorist.
Sources
If your dog seems distressed when left alone (howling, damage, not eating), ask your vet or a qualified behaviorist.