Dog Potty Training -Help!

Annika • Witch🌜Gamer 🎮 Ravenclaw 💙
My dog keeps pooping in the house. We have a dog door that she has finally learned how to use herself. She will go outside to pee, but NEVER to poop. 
I tried looking up things online. One piece of advice was to take her poop outside and leave it there instead of disposing of it so that her sent is there. I've done that 3 times now. Not working. 
The other piece of advice I found was to clean the area with baking soda and vinegar. I spent about 3 hours thouroughly cleaning the carpet like that. Also has not worked. 
I've punished her a couple times. But she is a VERY skittish dog and I feel like that is doing more damage than good. How can I get her to go outside??? Why does she go outside no problem to pee, but not poop? 😡
I can't grab her and put her outside if I catch her pooping because she knows it's wrong and will only poop when everyone is asleep or not home.