The owner can sell the house anytime he wants to.
Once it is owned by someone else the new owner can let you stay under the current lease or he can give you 30 days to vacate.
He may want to live in it himself.
Your lease is good until the end stated in the lease.
That is why you sign a lease;
to protect the landlord from you moving out whenever you feel like it and leaving him with no rental income and also to protect you from the landlord throwing you out in the street because something better comes along.