Why is my dog peeing and shitting everywhere?

My dog is about 6 months old. We thought we were going good with training but as she’s getting older, her behavior is getting worse. She pees everywhere and poops everywhere. Along with that my cat is spraying in random places, when she NEVER used to do that. My house is a disaster. We used to let my dog roam around the house when left alone but she destroys things as well. So now we lock her up in the hallway with water, food, a very comfy bed and many toys for her to place. SHE ALWAYS FINDS A WAY TO ESCAPE. I’m so over it and sad about this whole situation. I need help. I have pee pads in three different places and set her down each time she doesn’t pee where she’s suppose to. What do I do? Urgent help.