If a dog can’t cope with being left alone he’ll seem anxious before you leave him and then start barking as soon as you walk out of sight. He may also be destructive and/or soil the home.
This type of problem can be serious and difficult to fix so start by reading our 'Beating Boredom' and ‘Coping Alone’ factsheets and consider asking your vet for a referral to a behaviour specialist for help.
If this only happens at night when he is shut away to sleep by himself, consider letting him sleep in sight and sound of the family (e.g. on the landing with a baby gate) or in the bedroom with a family member.