I'm not a lawyer, so this isn't legal advice. Check with a lawyer. However . . . .
You have a lease with your landlord, the owner. Your obligation is to make the payments per the terms of your lease. If the property is sold to someone else, that action is between the buyer and the seller. The obligations of the lease will transfer from the seller to the buyer (regarding provision of housing, etc.). Bluntly, it's up to the two of them to coordinate payment arrangements. Technically, once the house is sold, the previous owner no longer has the right to collect rent from you. That right transfers to the new owner.
However, your obligation is to pay rent to the owner. When you are officially notified that ownership has been transferred (not that someone is buying the house . . . when someone has bought the house and ownership has transferred), then you pay the new owner.
Meanwhile, of course, keep complete records of your payments and evidence that payment has been made.
Beyond that, consult with a lawyer.
Hope that helps.