Yes, the buyer would step into your current landlord's shoes under the Lease & would have to honor all the Lease terms until the Lease expires. The new landlord could decline to renew the Lease upon its expiration, but they cannot try to kick you out early, assuming you are in full compliance with all Lease terms.
The seller (your current landlord) would need to transfer your escrowed security deposit to the buyer (as your new landlord), & at the end of the Lease term you would be seeking a return of your deposit from the new landlord. You should also receive a notice from the seller (or possibly the buyer/new landlord), instructing you where to pay your rent once the sale has been completed. If the notice comes from someone claiming to be your new landlord, I recommend contacting the seller to verify the transaction has closed.
The above information is not comprehensive & is intended as a starting point for educational purposes only. It does not create an attorney-client relationship with the author. It should not be used as a substitute for legal advice & counsel from a private attorney who can review your situation in detail & help you determine a course of action based upon your particular circumstances.