We had a Cocker Spaniel when I was young that would pee out of excitement/submission when visitors would come over. What we had to do was tell people who came over not to pet or pay ANY attention to the dog whatsoever for the first 5-10 minutes they were there. We told them not to even look at her. (It’s hard for people to do, ’cause everyone wants to pet the puppy, but you just have to explain it to them and hope they cooperate!) Once a few minutes had passed and her excitement had died down, as well as any nervousness she might be feeling, she was able to greet them without peeing on the floor. She got a lot better about it as she got older. It’s important, of course, to never get angry with the dog… all that’s going to do is make her fearful and perpetuate the problem (plus cause new problems). If you catch her in the act of having an accident, just say calmly, “No, Puppy, outside,” and take her back outside. You can clap your hands or make a funny noise to try to catch her attention and interrupt the peeing until you get her outside. Anger, though, will just send signals to her that she doesn’t really understand. I know it’s frustrating though.