It could be separation anxiety, I will copy and paste some tips I wrote up that deal with this problem, as well as information about crate training...
Does your dog cry when you leave the room? Urinate only when you leave the house?
These are a few signs that your dog may be suffering from Separation Anxiety.
Some dogs do not like being left alone and some will think you are leaving them permanently and not coming back. Here are a few tips to help fix this problem.
When you leave, no matter how long for always have fresh water available. Toys are also a wonderful training tool as it will keep the dog distracted, I use kong toys stuffed with yummy food as a cure for boredom, having special toys or treats that the dog gets only when you go out are also a wonderful idea.
When training my own dogs for separation anxiety I first distract my dogs with their favourite toy and then exit my house through the front door.
I only leave for a minute or two, just long enough so that the dog does not bark or cry.
I then re-enter the house and give them praise for not crying.
Next time I go out I leave for a few more minutes, again only entering the house if the dog is not crying and giving praise.
Increase the amount of time you leave for and always come back before the dog starts crying (you will learn how long that threshold is pretty quickly)
This teaches the dog that you are going to come back and they are not being left alone forever.
Another technique is to not "baby" the dog.
Some dogs become overly attached to their owner and don't even like their owner being out of their line of sight, in this case the training needs to begin before you start going out
Start paying less attention to the dog, when he pushes for attention, don't give it to him
If he wants to be petted, make him wait.
As harsh as it sounds it is the only way to get the dog to start becoming less dependant on you.
After you have trained the dog to be less clingy you can move onto things like leaving the dog in the living room while you have a shower, or leaving him inside while you are out hanging up washing on the clothesline.
This is very similar to separation anxiety training.
There are a few things to consider before actually starting the training:
Selecting a crate.
A dogs crate should be large enough for the dog to stand up in, turn around easily and be able to lay down comfortably.
Crates come in all shapes and sizes so shop around for one that best suits your dogs size.
I personally prefer to use all wire crates as to the plastic pet pack varieties as even though the plastic crates have ventilation they can become very hot.
When you leave, no matter how long for always have fresh water available, D-shaped water bowls are great for crates, they are shaped like a D and the flat part has clips to secure to the wire and prevent spills.
Toys are also a wonderful training tool as it will keep the dog distracted, I use kong toys stuffed with yummy food as a cure for boredom, having special toys or treats that the dog gets only when you go out are also a wonderful idea, it shows them that the crate is a good thing, not a punishment.
Another good idea for crates is to cover it with a blanket or sheet. You can leave the front open so the dog can see but having a blanket over the sides and back makes the dog feel more secure than a wire crate out in the open.
Another reason I prefer wire crates, you can adjust the covering to suit the weather.
When crate training my dogs I first coax them into the crate with a yummy treat, I let them eat the treat in the crate and play with a toy in there. Once they are comfortable with being in the crate I give them another treat then lock the crate and then go sit away from the crate and ignore the puppy.
I only sit down for a minute or two, just long enough so that the dog does not bark or cry.
I then walk over and let them out of the crate and give them praise for not crying.
Letting them out only if they are not crying is very important. If you let the dog out of the crate while it is crying it will only teach them that crying makes you come back and let them out.
Next time I sit down for a few more minutes, again only letting them out if the dog is not crying.
Increase the amount of time you sit for and always let them out before the dog starts crying (you will learn how long that threshold is pretty quickly)
This teaches the dog that they are not being left in the crate forever.
A lot of people prefer to leave the house while they are crating their dog to start with, this is purely personal preference, I have tried both and had more sucess with staying near the dog.
The only attention the dog shoulg get should be an angry "no" from you when it cries to show it that crying is naughty.
Just remember, however loud and hard your puppy is screaming do not let it out of the crate. It will calm down and then it can come out.