Well this can be a serious problem, but your dog is doing what is natural. He is alone and he is lonely and probably a little scared when the alpha of the pack leaves him alone. It's isolation and separation anxiety mixed in one and this can be a little difficult to resolve.
I'd actually suggest consider getting ANOTHER dog so that he is not all alone when you leave...but perhaps that is not an option for you.
Most dogs that bark like this may have been inadvertently rewarded for their excessive barking. When he first started this - the VERY first time he did this - did you rush back in and comfort him and tell him "there, there" sort of thing? If you did, then you rewarded his barking and taught him that it brings solice and comfort to him and YOUR RETURN when he does it. So you basically taught him to bark at your leaving.
So the trick is NEVER to come into the house when he barks - even if he does it upon your return home. Wait until he is QUEIT, THEN go in and praise him. Even if in the beginning his quietness is only a few seconds make sure you NEVER respond to his barking. If so he will VERY quickly associate that when he STOPS barking he is rewarded with your presence and when he barks you do not respond. Practice this on a weekend when you can go in and out frequently.
You can try this next method which I have read about but not ever tried myself. I'll admit I am not a big fan of it, but rather than get kicked out of your apartment or see another dog brought to a shelter I'll suggest it to you to try if the above does not work for you - but give the above method a good attempt first.
The other thing is to leave your house in the normal way (wearing what you usually wear or what you usually take). Take a glass of water or a water pistol with you.
Go far enough away that you can hear him when he starts to bark.
When he does RUSH BCK IN and spray him with water while saying NO!
Leave IMMEDIATELY after without praising or comforting the dog.
Repeat the above process until he goes five minutes without making a sound. Then go back inside and praise him. Not TOO much as you do not want him to think that your leaving or arriving is anything special...or anything worth barking about.
These are two methods that may work for you.
Good luck and keep us posted.
Anyone else have any good suggestions for her?
Bookmarks