Separation anxiety is a common problem with pets but is often misunderstood by their owners. My foster dog has a continuing case of separation anxiety. I think it stems from his being a stray and he may have been abused. Someone dumped him out in the countryside when he was about two years old. When I found him he was skinny, dirty, and scared. When this type of thing happens to an animal it is very unnatural and traumatic. Dogs are pack animals and expect to be around other dogs (and/or people) that they are familiar with for much of their lives. When they are suddenly and abruptly removed from their normal environment they can experience a lot of difficulty including some undesirable, and often destructive, behaviors.
This dog has exhibited the classic signs of separation anxiety. Over time he has calmed down a little and he has become a really good dog. However the anxiety factor is still part of his persona. He is hyper-sensitive to keys rattling, putting shoes on, or any human behavior that makes him think he might be left behind. He follows me everywhere and simply can not cope with being alone. He has broken out of his crate and destroyed a sheet metal door, pulled down curtains, overturned potted plants, and so on. He is especially aware of the automobile as going for a ride is his favorite activity. If you step out of the vehicle, like putting fuel in, he becomes agitated again. He can not really help but exhibit this behavior so punishment will not help him and may even make matters worse. Understanding this behavior is the key.
Medications for anxiety are usually not an optimal solution. Dogs do not react to medication the same way that humans do. Also, you must make sure the animal has access to fresh water, toys, and anything else that might take attention away from your leaving. Do not make a big scene when leaving. Slip out quietly and quickly. Leave a radio on. Make sure your animal has a lot of exercise and frequent "potty breaks". Fill up a Kong with peanut butter or his/her favorite treat. Think of ways to keep the animal occupied and distracted from your leaving. Never leave a dog alone more than eight hours. Remember neglect is a form of abuse.
There are some steps you can take to modify your pets behavior. First you can try to desensitize him or her by making the sounds and movements like you are getting ready to leave and then not leaving. It takes a lot of patience and time for this to work. Rattle keys, put shoes on and then just sit with your pet. After that you slowly build up to walking out the door for a very short time and coming right back. Gradually increase the amount of separation time. Rewards and treats work great. They just need to know that when you leave you will come back.
Some helpful separation anxiety articles.
It's me or the dog video