(b) With respect to residential real property or a dwelling where the term of a bona fide lease extends more than 90 days beyond the date of the expiration of the time for redemption, the immediate successor in interest must allow the tenant to occupy the premises until the end of the remaining term of the lease, and provide at least 90 days' written notice to vacate, effective no sooner than the date the lease expires, provided that the tenant pays the rent and abides by all terms of the lease, except if the immediate successor in interest or an immediate subsequent bona fide purchaser will occupy the unit as the primary residence, the immediate successor in interest must provide at least 90 days' written notice to vacate, given no sooner than the date of the expiration of the time for redemption, effective no sooner than 90 days after the date of the expiration of the time for redemption, provided that the tenant pays the rent and abides by all terms of the lease.
For purposes of this section, a "bona fide lease" means:
(1) the mortgagor or the child, spouse, or parent of the mortgagor is not the tenant;
(2) the lease or tenancy was the result of an arm's-length transaction; and
(3) the lease or tenancy requires the receipt of rent that is not substantially less than fair market rent for the property or the unit's rent is reduced or subsidized by a federal, state, or local subsidy.