Sudden changes in elimination habits should always be checked for medical issues. You didn’t specify, but I’m assuming that you’re talking about urination. Urinary tract infections, bladder stones, and other issues need to be eliminated as possibilities before you start scolding a dog for misbehaving. Preferably, you should make an appointment to have them checked. If you’re trying to save costs, take a urine sample from each dog into the vet to be checked to see which one may have the problem and then get that dog in to the vet.
If you eliminate medical problems, then behavioral is your next guess. Start from scratch. Don’t give them treats for asking to go outside, sitting by the door, or going outside – give treats for using the bathroom outside. Take them out on a leash every couple of hours (one at a time) and give profuse praise and treats when they potty. The reason for the leash is that you need to be near when they use the bathroom – if they’re outside running loose, you can’t reward them when they go. Dogs are very literal. They cannot correlate getting a treat by the door with peeing outside in the yard. Be consistent. Be persistent. Once they reach the stage of automatically peeing and pooping outside, you can start letting them out on their own.