Consider yourself fortunate your landlord informed you the house is for sale. Legally that is not required.
The new owner has to honor your lease until it expires. The terms and conditions of the lease apply to the new owner.
If the new owner wants you out before your lease is up, then this is good. Make the new owner an offer to move out and shoot for the stars!!! You might end up with a nice stash of money that will help you pay for your move and the security deposit plus much more.
Finally there is an unofficial rule I call crap or get off the toilet. If someone is interested in buying the house then you have to allow the owner to show the house with proper notice. But if a prospective owner wants to see the place multiple times then you have the right to tell the current owner and future owner to get lost. If a person has to see a property more than 3 times then don't put up with that. Tell your current you don't have time to waste on people who can't make up their mind.