My 3 year old female is peeing in the house!! Any tips/tricks?

Ari

We got her over the summer she is a 3 year old dutch Shepherd/cattle dog mix. She’s a very sweet dog and I know she is smart cuz she has learned a lot already but she keeps peeing in the house when we leave, even for an hour. I know she probably has anxiety we do have another dog for her to play with and she loves him. We can take her out as much as we want right up to the last minute before we leave and if we leave her out she pees or poops on the floor (mostly pees). I grown up with dogs and our male that we have had for 4 years hasn’t done that since he was 5 months old and he only did it twice then. She does come from a background of abuse but she has come a long way. Any tips or tricks that anyone knows of to stop it. I know she probably has anxiety but I don’t want to crate her anymore when her “brother” gets to be free and look out the windows and see the squirrels and bunnies all day and she’s cooped up.