Do you have a signed lease with the landlord? If yes, you're fine because the landlord cannot evict you since the lease stays with the sale.
However if you don't have a signed lease, then your landlord must give you 30 days notice. Sorry but you need to move out.
Never rent anywhere without signing a lease so this way you're family is protected. When you rent without a lease, the landlord can kick you out at anytime.