Observe your dog to see if you can start to spot the signs that they need to relieve themselves, for example they might start to sniff the ground, turn around in a circle and then start to squat. If you see these signs, calmly interrupt your dog and pop them outside to see if they’ll go to the toilet. Try not to be too exciting so your dog doesn’t become too distracted, simply be patient and wait. If they go then reward them but if not just quietly return indoors – but don’t be in too much of a rush, give them time as it’s likely that they did need to go when you spotted their particular signs, and although you’ve necessarily interrupted them the feeling of needing to go is likely to return fairly quickly.
Once they’ve learned that toileting outside is a good thing to do, they might begin to ask to be taken outside by whining and moving towards the door, so again be sure you respond appropriately to their communication by taking them out and rewarding them for toileting.