My new puppy keeps on peeing on bed. How do I stop her?

Hi! We bought a new toy poodle puppy and named her Pepper. She is now close to 5 months. But she started peeing on my bed, literally all over. We have read that you shouldn't hit or scream at your dog when they do something wrong. So instead, when she pees and caught in act, we put her in her playpen alone for a few minutes. She cries but she still do it on the same day, and day after, and the day after.

The thing is, we have another dog. It's a male dog. And whenever she pees in bed, he does it too. He pees over Pepper's pee.

Now my question is how do I stop pepper into doing that? I don't think she learns when keeping her alone as punishment. Insetad, after setting her free, she just becomes more hyper and I don't think she realizes her mistake since she does it again on the same day.

We literally just bought a new bed mattress early this morning since the last one is stinking from the pees, and now they peed again.

Please help, it's driving us crazy.