Only a judge can evict you. You have the right to stay in your apartment until that happens and to raise defenses and claims in court against the new owner. If you lose the eviction case, you can also request up to six months (or up to 12 months if some one in your household is 60 years of age or older or has a disability) from a judge before you have to move.
Someone may offer you "cash for keys"; asking you to move out very quickly in exchange for money. That person may try to convince you that you have no choice, but that isn't true. You don't have to take the deal. But if you do you may be giving up your legal rights and moving much sooner than necessary.
Even if the bank sells the building with the provision that it be delivered free of tenants, that is not your problem, and does not affect your right to stay in your home and defend against eviction until a judge tells you that you must leave.
Being in a foreclosed building does not, by itself, entitle you to withhold rent. If a bank takes over and doesn't want to accept your rent, keep a record of your offer to pay.
Even if a bank takes over the building, they are still legally responsible for maintaining it. If you're having problems with repairs or services that the owner is supposed to provide (like utilities), you should contact the bank or its broker or attorney, preferably in writing, and let them know what is needed.
The new owners of the building are legally required to post their names and addresses in the building. You can also find the owner through a "Property Search "at the Registry of Deeds or at www.suffolkdeeds.com.
If you are being evicted in court, it is a good idea to seek legal assistance as soon as possible. For those who are low-income and eligible for free legal services, there are agencies that may be able to help.
If utilities that the owner was supposed to provide (like water, or common area lights, or heat or hot water) have been shut off or are threatened with shut off, let the bank or the real estate broker know. You may be able to keep service on by paying a projected bill, and can deduct these payments from any rent due.
If you have a rental subsidy, let the subsidy agency know about the change in ownership, so that they stop paying the old owner. You should have additional eviction rights because of your subsidy.
In the event that you have to move out, there are agencies that can offer you housing counseling and assistance.
Massachusetts Housing Consumer Education Centers