Whether your co-tenants split on you and leave the rental unit or if they split on each other and one is left holding the bag (or the lease as the case may be) you’re covered by the lease you had them both sign, you did have them both sign the lease, right?
If your tenants leave your rental unit and both of them are on the lease then they?re both responsible for leaving the property clean and undamaged. If there will be expenses that aren?t covered by the security deposit then you legally can go after one or both of the tenants. The law provides for this with joint and several liability which means you can go after one or both of them (especially useful if one has split town) and then its up to the tenants (and now plaintiffs) to pay the bill between them.
If one tenant has split and left the other with the apartment you can still hold the other legally responsible as long as they’re on the lease, but you may want to conduct an inspection with the remaining tenant and assess damages at this time. Then you can sign a new lease with the remaining tenant. This is actually just for the tenant’s benefit but it will go far toward proving your understanding of their situation.