If your barking dog sounds upset when you are home, go to your dog and see what is upsetting them. Try to lure them away from the window or into the house if the dog is outside, by using enticing food like lunchmeat. Be careful not to yell at them or grab them. A very upset dog may try to nip at you. On the other hand, if this type of barking happens when you leave the home, please set up a video to help identify how your dog looks while barking.
If the dog is howling, panting and pacing, they are likely upset and anxious, which is obviously an unpleasant emotion for them. If your dog is at the window barking at people or animals going by the house, then another strategy is necessary. Talk to your veterinarian about how to safely block the windows. If after viewing the video it appears that your dog is anxious, take the video to your veterinarian to discuss how to begin treatment for separation anxiety.