Advice needed on training please?

So I have a 3 year old female pitbull and a 4 year old male pitbull. They are reasonably well behaved dogs my male is very intelligent however they still have toilet accidents in the house. NEVER EVER when we are in the room, for example it’ll happen when we are in bed or when we go out. My female has severe separation anxiety and I believe she toilets when we go out due to this. My male doesn’t appear to have separation anxiety but many times I’ve come home and he has peed on furniture or the walls of our home. This has caused damage to the walls and skirting and is really getting me down. We have just recently spent a fortune redecorating the house and in the process of binning old furniture and replacing it with new stuff and I want to put an end once and for all to these accidents. I’m at my wits end with it and it’s really affecting my mental health now. Never in my life have I come across dogs their age still toileting in the house it’s beyond a joke and I’m just so deflated it feels like they’ll never stop and I just can’t have it anymore. Please help me 😭