Lots of dogs have this problem. Here is how to solve it. First, don't punish your dog as she really can't help it. It just kind of happens.
Second, we have to keep her from getting excited in the house. So, when you come home, don't talk to her and don't greet her right away. Just let her follow you right outside and let her pee. Then get all excited when you praise her.
If she is peeing from excitement even when she is outside, try to tone down your enthusiasm. Greet her calmly. Get down on her level, sit on the ground, and talk to her sweetly. Some dogs pee because they are a little afraid of people, so try not to stand over her. Getting down on her level should help her feel more comfortable and less afraid.
As always, be sure to check with your veterinarian to make sure your dog is healthy.