You will be given written notice with plenty of time before the transaction takes place so that (if necessary) you can find other accommodation. However, in some cases, you will likely be able to remain living there, only with a new landlord.