The Lease Stays in Place
Selling the house does not end the lease. Whoever buys the house steps into your shoes as the landlord, with the same rent, the same end date and the same rules.
If the tenant is month to month, the new owner keeps that arrangement unless they give proper notice under the lease.