IIRC from my leasing days…
The landlord will want all the tenants on the lease. Essentially, as others mentioned, they are jointly and severally liable for the entire rent, damages, etc. If A skips town or cannot pay the rent, B is on the hook for the full amount.
A term lease either has an escape clause - i.e. 60 days notice from month end - or it does not. If it does not, then the tenants are on the hook until the end of the lease. However, depending on the circumstances, it can be expensive for the landlord to insist on the letter of the law. There’s the old joke about “lease-breaking party”, have a bask so loud and obnoxious, that the other apartmetns will complain and the landlord would be better off cancelling the lease than allowing repeated noise violations.
From what I recall, it usually boiled down to - the tenants could sublet for the remainder of the lease, and the landlord could not unreasonably block that; or the landlord had to make honest effort to find replacement tenants, and the original tenants were on the hook for any rent until a replacement was found.
If, as the OP seems to discuss, the situation is that one tenant wants or needs to leave - well, sucks to be the other tenant. This is why the landlord wants to put both tenants names on the lease - if A wants to leave, or is tossed in jail, or quits their job, then B better be prepared to find a new roommate or pay the full rent. OTOH, as long as B pays the full rent, the lease is still in force. Obviously, there is no pressure on the landlord to remove A from the lease - he’s just added insurance if B fails to pay.
To rememdy these situations, and “level the field”, IIRC the Ontario laws make some interesting provisions that have really ticked off the landlords - requirements IIRC to add people to lease, cannot deny access, i.e. can’t stop an new boyfriend from moving in, etc. This results in exactly the scenario - the carefully vetted tenant moves out, they have to remove them from the lese, but can’t evict the unreliable boyfriend until he’s missed several rent payments…