Dogs left alone for long periods, whether in the house or in the yard, can become bored or sad and often will bark because they are unhappy.
Greeting/Play: Dogs often bark when greeting people or other animals.
Separation Anxiety/Compulsive Barking: Dogs with separation anxiety often bark excessively when left alone.