When leaving ends the rent
It depends on whether you had valid grounds to leave and followed the proper steps. If a serious condition made the unit uninhabitable and the landlord failed to fix it after notice, you may be relieved of future rent under the idea of constructive eviction. If the requirements were not met, you could still owe rent.
When leaving is justified — the problem was serious, you gave notice, the landlord did not act, and you moved out within a reasonable time — the law may treat the lease as effectively ended, so you are not on the hook for the remaining rent. When those conditions are not met, a landlord may claim you broke the lease and owe the balance.
Even where a landlord claims unpaid rent, California generally requires them to make reasonable efforts to re-rent the unit rather than simply charging you for the entire remaining term, which can limit what they can recover.
Because the outcome hinges on the facts and your documentation, it is worth confirming your position. If you are worried about owing rent after moving out over conditions, a free, confidential review can help you understand where you stand.
This is general information about California tenant rights, not legal advice. Every situation is different.