I'm so sorry to hear that you're having this issue, although it's a common complaint for owners of cats.
One of the easiest way to determine who is doing this, is to separate the cats one at a time until someone has an accident in the house and is the only one who had access to the area. The hard part, then, becomes determining why the inappropriate elimination is happening. There are so many things that can cause this. New type of litter box, new type of litter, new people in the home, movement of furniture, addition of new items into the home, intact cats in the area calling for a mate...and then medical issues like a bladder infection, kidney issues, hyperthyroidism, etc.
We often see that stress plays a big role in where cats go if it's outside of the box. Some cats will go on the carpet outside of the box and no one sees them, others will hop right into the bathtub and go while their owner is watching them. Many veterinary professionals feel that cats try to draw attention to their concerns through this behavior outlet. The hard part is, pun intending, eliminating the things that don't apply and finding the reason a cat might do this. And that starts with finding out which cat is to blame.
I would recommend that once you find out which cat is at fault, that you schedule an appointment with your vet for a thorough physical. Your vet may want to run some labwork, test the cat's urine and so forth to ensure that there's nothing medically wrong.
During this time, you may also try adding more boxes into the home, in different rooms, with varying types of litter. Although uncommon, some cats prefer to use the bathroom on softer litter so something like yesterdays news or even just shredded newspaper could be preferred. You might also try to use some puppy pads if you can predict where your kitty prefers to go, just to protect your flooring. Also try to keep the boxes clean. Some cats do have a preference toward a clean box and will avoid using one if another cat has used the box already. If you find that this in the case, a bigger litter box or one with more surface area might help. One thing that clients report working really well is a sweater box (made by sterilite, the type that you can slide under the bed) as it's quite large and flat, but gives cats a chance to use one part or the other without coming in contact with other waste.
Finally, there's a risk that this could be exclusively behavioral. Now, if both of these kids have lived together for the entirety of their life...this is pretty uncommon. There's usually some type of stress in the home that the cat reacts to (for example, in my own home, all of our cats use the boxes religiously except for Gus when he sees us preparing for a trip. The cat will pee in our luggage if within a stone's throw of it so we know to keep him away from the luggage when we're putting items into it. If there's nothing in the luggage, he won't pee in it). Some cats do have idiosyncracies just like we do :)
If there are more details to share, this may help me in helping you determine what might be causing this behavior. Above all, I'd consider this a medical concern until you can determine that it's not. Once that's ruled out, there's lots of info contained herein to try to help you work through the issues.
If my answer has helped you, please click accept. You're still able to reach me once you've accepted my answer and I'll be happy to continue to help you work through this concern with your kitties. It's been my pleasure helping you :)