The other person answering is correct--the new owner takes the property subject to all interests in the property, such as the lease which bound the seller. Remember, it may take a long while to sell the property, and it is entirely possible that the term of the lease will expire before it gets sold.
This scenario could work in your favor. If the property hasn't sold by the time your lease expires, the landlord will be in a difficult position--he won't want to have a long-term lease to renew with you for fear that it would make the property unattractive to a buyer, but he may also not want to lose the rental income that he can get from you being there as a tenant. You might want to consider renewing the lease with a provision that if he sells the property to someone who wishes to use the house for their own residence that you be given a month of free rent, or a certain amount of money for moving expenses. Or, ask for a rent reduction based upon the uncertainty.
Good luck working your way through this, but consider the landlord's actions as an opportunity, since the lease you have will be binding on the buyer.