There are a few problems with punishment. First of all, it's coming way after the fact. She has no ability to connect the eliminating with what your mother is doing. To a dog, that is just scary. She has no idea why she's being hollered at. Your mom comes in and frightens the dog. That's all it is to the dog. This punishment is associating your mom or whoever else hollers at her with fear and probably some distrust.
Dogs will appease humans who are overwhelming to them. (even if it's not severe) This is stressing her out more than just the being alone. When your mom found the poo, your dog was not thinking, "Oh no..mommy found the mess, now I'm in trouble." It was likely more like, "Oh no....mommy is here and I'm frightened. I better go hide." Mommy coming home is a predictor of punishment. Mommy's countenance when she sees the poo or expects to see the poo is a predictor of a frightening time.
You say she won't go outside when you take her for walks. If this dog has been punished for going poo in the house, this will cause her to not go to the bathroom while on your walks. When a dog is punished for going inside, she does not think that going to the bathroom inside is "wrong"....morally wrong and yucky to humans. She doesn't understand that we love our carpets and that poo ruins carpets. She has no concept of all that. She's an animal.
She thinks it's scary to go to the bathroom in front of humans. Something is either safe or unsafe to a dog. In the wild, they do things which are determined by either being safe or unsafe. That's how they're wired. They have to be or they wouldn't survive very long. Going to the bathroom equals
unsafe if it's in the presence of humans. It
is safe if no humans are around because they don't get punished when humans aren't around. That's as far as it goes in their little smooth brains.
Dogs often will hide where they go because going to the bathroom is quite a scary thing....just in case a human walks in the room. (if they've been punished for going to the bathroom)
Again....regain this dog's trust. Stop punishing her or making any kind of fuss over the poo. It's not her fault. It's the humans fault. She's stressing. Crate her when she can't be supervised until she's back on track. Don't leave her loose in the house where she has any opportunity to eliminate inside. She's found out that it works well enough to go inside as long as no humans are present. You need to prevent it and
show her where to go, reinforce her lavishly for going outside and keep it up for a long time until you try her in a smaller room for a while.
Do you have a cue word for eliminating? When she does go outside, while she's going, not before, not after, but at the same time, add a cue word, like "go poo" or "go pee". Later, when she's made the association between going and the word, you'll be able to gently remind her before she goes, but for now, use the word while she's going. And the instant she finishes, not 3 seconds later, but the instant she is finished, throw her a party complete with a high value treat and lavish praise. Everytime. It may take her a while to go in front of you now, but don't take your eyes off of her inside. Don't let it happen again inside.
Give her plenty of opportunities outside. Play with her for a while, make it all fun and see if she'll go while she's having a wee of a good time. Maybe she'll forget how scary it might be to go when you're there. But you have to be present in order to reinforce her. You might stand a little ways off but so you can see her if she goes and then hurry and get that piece of chicken to her. It needs to come within 1 or 2 seconds.
I'd get her primed to a marker word so you can mark the behavior and then treat. Look up clicker training if you want to. It's all explained there how to get her to learn what a click or a marker word indicates.
http://www.clickersolutions.com/articles/index.htm
She doesn't know. Dogs are not human and do not think like humans, don't have the same values or morals as we do. They can't understand all about our internal make-up....what we're thinking or stressing over. They know we're stressed, but they don't know why. When a dog is happy and trained, she will not do that, unless she simply can't hold it anymore. Something is out of balance here. But I think you can re-train her and get her back on track. Be patient and take it gradually. Don't put too much pressure on her. Either use a crate or if she's ok in the bathroom, use that. But she may go on the floor which will reiterate to her that it's OK to go in the house, since it works. Remember: dogs do what works. They're not out to get back at you. It's just the way they are....animals with small, unconvoluted brains.