Residential Tenants and Just Cause Protection Under Civil Code Section 1946.2
Civil Code section 1946.2 sets the rule. Its text reads: "after a tenant has continuously and lawfully occupied a residential real property for 12 months, the owner of the residential real property shall not terminate a tenancy without just cause, which shall be stated in the written notice to terminate tenancy." Where additional adult tenants join the lease before an existing tenant reaches 24 months, the rule applies only if all tenants have occupied for 12 months or more, or one or more tenants have occupied for 24 months or more.
"Just cause" comes in two kinds. At-fault just cause includes, among other listed grounds, default in rent, breach of a material lease term, nuisance, and criminal activity. No-fault just cause includes owner or close-relative move-in, withdrawal from the rental market, compliance with certain government or court orders, and intent to demolish or substantially remodel. A pending sale is not among the grounds the statute lists.
A no-fault termination carries added duties. The owner must either make a relocation payment or waive the final month's rent in writing. The amount equals one month of the tenant's rent in effect when the notice issued. Any relocation payment is due no later than 15 calendar days after service of the notice. The statute says an owner's failure to strictly comply with this subdivision "shall render the notice of termination void."
Not every unit falls under the rule. The statute names several kinds of property it leaves out, including transient hotel occupancy, certain shared-facility arrangements with a resident owner, and housing issued a certificate of occupancy within the previous 15 years. That last exemption applies unless the housing is a mobilehome. The list continues beyond these examples, so a seller with newer apartments upstairs may find that some or all of them sit outside the rule.
The California Attorney General's Landlord-Tenant Issues page describes the Tenant Protection Act as creating "statewide eviction protections for most residential tenants after they have lived in their unit for 12 months."
Local rent control and eviction rules
The statewide rule is not always the only one. The Attorney General's page notes that local rent control laws may further restrict rent increases, and it describes landlords as needing to comply with "all state and local requirements" for certain evictions. In plain terms, the statewide rule and a local ordinance can apply to the same apartment at the same time. A building in a city or county with its own rent or eviction ordinance may carry those local rules into the sale as well, and a buyer reviewing the rent roll will usually look at both layers.
In practice, the apartments generally go to the buyer still occupied. A qualifying tenancy cannot be ended just because the building is under contract. The just cause rule reaches only the residential units; the commercial spaces are governed by their own lease terms.