Hey Jenny Joan, try using a pet calming plug-in diffuser to try and relax them - it could be caused by stress and may take the edge of it.
Check that it really is pee - dogs often use a comfy mat to groom and it could be just excessive slobber (?)
Take away the mats - often they can still smell where they have been, even after a good hot wash and repeat the action - don't put the carpets down for a couple of weeks and see if the issue repeats itself.
Really, really over praise when they go to the loo outside - treat ad make a BIG fuss. If they pee indoors - don't shout - completely ignore them whilst you are clearing it up to ensure they know that no attention will be gleaned from this action,
Good luck.