Recent canine behavioural science has established a reason for why dogs seem to know when their humans are about to come home.
Amazingly, as is often the case with dogs the answer is stranger than we first assumed, dogs are able to predict timely returns of their human by analysing scent trail routines.
When the human is home the house is full of their scent. The dog has established that when the human is at home, the home is at 100% scent rating.
As soon as that human leaves the home (let's say every morning for work) their scent rating in the home begins to drop from 100% to 0%.
Due to the acute sense of smell of your dog, their human’s scent gradually dissipates over time. So when you leave for work in the morning your scent rating in your home falls from 100% to 99.9% and so on down to zero; but of course, then you return from work at 6 p.m.
Just prior to you opening the front door; your 8 to 9 hour absence in the home has left it's scent rating at, lets say, *65%.
As soon as you enter your home, the home scent rating for your individual smell immediately rises to 100% once again.
With consistent repetition of this scent trail routine, your dog will come to rely on the fact that when the home's scent rating for your particular smell falls to a certain percentage each day (*65%) it is time for you to return and fill the house with your scent once again.
On top of this exquisite system, your dog is also able to detect you by the sound of the weight of your footsteps; as these are unique and individual to you. If you have a gravel footpath for example, or you have a concrete driveway the weight of your step will give your unique presence away to your dog.