A very good question. As Brenda points out, checking before hand is a good thing to do, however, things change with the passage of time.
The â€œProtecting Tenants at Foreclosure Actâ€, a Federal Law, ensures tenants receive proper notice of rental home foreclosure and protects them from abrupt or improper removal from the home.
Under this Act - Public Law No: 111-22 (S. 896E) (Enacted: May 20,2009) â€“ a new property owner cannot evict a month-to-month tenant for 90 days. When there is a lease in effect the new owner cannot evict until the tenantâ€™s lease ends. With one exception, when the new property owner is going to use the rental property as his or her primary residence, in this case the new owner must give the tenant 90 days notice.
Once the foreclosure is complete and a bank, financial institution, Fannie Mae or Freddie Mac own the property....occupants may be eligible for assistance, such as "Cash for Keys", as inducement to vacate the property. If the property is purchased at trustee sale by a private party, such programs may not be available.
Unfortunately, you may need an attorney to assist you enforcing your rights.