Punishments are a terrible way to train any pet and must be avoided at all costs. Positive reinforcement is the best way and works much better than other approaches. Whenever the kitten uses the litter box, praise her by petting her and making comforting sounds.
NEVER rub her nose in the mess if she has an accident. Instead, let her sniff the mess out and then gently put her in the box so she’ll associate poo time with the box, and will learn where to go.