Dog trainer here 👋 Long training based reply here (sorry in advance for the length):
Separation anxiety to the point where there's urination or defecation is extremely severe and, ideally, the dog should not be left alone, at all, until a solution is found and worked through. IMHO you need to question whether this is fair on the dog really (sorry to point that out, but it is true).
However, what you may think is SA could just be incorrect toilet training. The following questions help to suss it out:
- Does the dog mess with you in the room?
- Does the dog mess with you in the house, but not the same room?
- Does the dog toilet when let outside into the garden?
- Are you cleaning the mess with a) bleach or b) water/mild antibac?
If yes to question 1, the dog is simply not understanding toilet training or where to go, or he/she may have a bladder/colon problem. Vet check needed before retraining, properly.
If yes to question 2, the dog is more likely to have been told off for defecating/urinating in front of a human, and therefore, he/she doesn't know where to go but he/she just knows definitely not in front of a human. Vet check to rule anything out and retraining, properly.
If yes to question 3 - are you rewarding that? With food? Is it on cue like "go to toilet"? It should be, work on that, it's very useful to have that on command!
If yes to 4, your unknowingly making the pee smell stronger, thus creating a cycle of "here is the toilet". Immediately stop using bleach or bleach-based anti-bac. Zoflora, for all it's haters, is one of the best things to use on hard floors. Alternatively, a pricey bottle of special stuff from the pet shop will also work!
Wishing you all the best with this situation - it's a stuggle to have a clean house with dogs and kids anyway (3 collies and counting here), let alone an incontinent one too 