Make sure you get the dog regular exercise so the dog will be tired.
You can also leave a radio on so the dog won't feel alone when you leave or are gone and they won't cry as often when you leave.
Also when leaving or coming back home don't make it a big deal to your dog.
Another good idea to get the puppy or dog to stop crying when you're leaving is to get the dog or puppy a toy such as a "food Puzzle" toy to keep him/her occupied.