A written lease for a definite period is valid for the period stated unless and until a house is sold. Then the lease terminates by operation of law and the tenant then becomes a holdover tenant and can remain in possession of the premises at the pleasure of the new owner as long as both parties agree. A month to month tenancy is created by this arrangement. It is no different than any month to month tenancy and requires notice of termination by the landlord to end the tenancy. Your security deposit is held by the new owner and must be returned pursuant to the terms of the written lease agreement.