My little girl (dog) has been acting weird lately, peeing/poop in the house, two days ago i had to scrub the rugs cause i didn't know she squeezed thru the baby gates a poop in the livingroom Micah stepped in it and ran all over the house before Mike saw it on the rug, i was to busy trying to make dinner

oh was i pissed off, now this morning she jumped on the couch and peed!!! What the heck is she doing, i rubbed her nose in it and she got a smack on the ass and both dogs are going to stay in the basement while im at work... i hate to punish my other dog.. but... i don't know what to do.. i put there toys, water bowl, treats, beds, and they have a couch and tv down there, so its not like there in a box, the basement is way bigger then my kitchen. so they do have more room down there, i just don't know why she is acting up..... does anyone know why she is doing this?