Your dog seems to suffer from separation anxiety - if you google it you should find some good ways to help him learn that it's not a bad thing when you leave (he gets lonely, just like we do).

One thing to stop doing (if you are doing it) is to make a big fuss over him just before you leave - don't even say goodbye, just go.

Another thing is to give him something to do - there are treat balls (I have one called a kong) that you can fill with some small treats or a little peanut butter or cheese - give it to him just before you leave and leave while he is busy with it. I've also got a larger ball (which I brought from Canada) that I can put some of the kibble in - in order to get them out the dog has to push the ball around - they don't come out every time so he's kept busy for a while.

As I said, try googling separation anxiety and look for positive ways to reinforce the desired behavior.