If she is a small dog, try her with a litter tray, (cat litter will do). If you can put it in a corner in the kitchen, and keep an eye on her. When she crouches, quickly pop her in the tray, she'll soon get used to it. When she does perform, praise her, and give a a dog treat. As she gets used to the idea, gradually move the tray closer and closer to the door, and then to outside. The two methods you have been trying, are definitely a no-no under the recent new Animal Welfare Legislation. Also the dog will not connect the scolding with what she has done, and putting her outside for 2 hours, is quite a bit too long, as at 4 months she is still only a baby in dog years. Hope all goes well. And if not, I think you might consider re-homing her. But I hope it doesn't have to come to that. Good Luck. Please let us know any progress.