It sounds like your dog has some pretty serious separation anxiety.
You need to work on him in small increments and associate your leaving with something really positive, something he never gets except when you aren't there.
Find a food he likes. You can try a meat baby food like ham, etc. Give him the jar to lick out of, then leave the room for 30 seconds, then go back in and take away the food.
Gradually increase the length of time that you are gone.
You can put the food in a kong toy and freeze it so that he is occupied for longer
Work up to giving him a treat, then going outside, waiting 30 sec, then coming back into the house. Gradually increase the length of time you are outside.
This will help to relieve his separation anxiety by associating your leaving with a positive experience
If he still has problems, your vet may be able to provide you with something like prozac, which can also help this condition
I hope this helps