Landlord need to honest with their tenants and tell them in advance or their signing the lease that they intend to sell the house.
If the owner decides to sell right in the middle of the lease, then it’s the landlord’s responsbility to be extra nice to get the tenants’ cooperation, not the other way around.