Well, it depends on the context.
When is he peeing on people and how? Like is he sitting in their lap, walking by and lifting his leg, etc. Sometimes dogs can get overexcited and pee (such as when a new person arrives and greets them) - but that can be fixed with training and a bit of a behavior change on the people's part. If it's happening while he's just sitting around the house though, it could be a medical problem that's causing him to go more frequently or preventing him from holding it rather then something he's doing intentionally.
If this is a puppy you should not punish her. She may be submissive peeing.. not intentionally peeing on people. Submissive peeing is like being so afraid she loses control. Some male pups will roll on their backs and pee straight up like a fountain. If you punish them for this, they will become more afraid and may resort to other, even lesee desirable behaviors.
Punishment is not the way to handle this.. and, in fact, can make it worse.