(a) Except as provided in this section, a landlord may not retaliate by discriminatorily increasing rent or decreasing services or by bringing or threatening to bring an action for possession because:
(1) the tenant has complained to a governmental agency charged with responsibility for enforcement of a building or housing code of a violation applicable to the premises materially affecting health and safety;
(2) the tenant has complained to the landlord of a violation under Section 35-9A-204; or
(3) the tenant has organized or become a member of a tenant's union or similar organization.
(b) If a landlord acts in violation of subsection (a), the tenant is entitled to the remedies provided in Section 35-9A-407 and has a defense in any retaliatory action against the tenant for possession.
(c) Notwithstanding subsections (a) and (b), a landlord may bring an action for possession if:
(1) the violation of the applicable building or housing code was caused primarily by lack of reasonable care by the tenant, a member of the tenant's family, or other person on the premises with the tenant's consent;
(2) the tenant is in default in rent;
(3) compliance with the applicable building or housing code requires alteration, remodeling, or demolition which would effectively deprive the tenant of use of the dwelling unit; or
(4) other material violations of the lease.
(d) The maintenance of an action under subsection (c) does not release the landlord from liability under subsection (b) of Section 35-9A-401.