If a private person or investor—not a bank—buys your building at foreclosure, the Just Cause Eviction Law does not protect you. But you still have rights.
If the foreclosure was in 2014 or before and you were a tenant before the owner got the “notice of foreclosure,” they should give you at least 90 days’ notice, or until the end of your lease before they file an eviction in court.
If the foreclosure was in 2015 or after, they usually only have to give you 14 or 30 days notice.
If the new owner is not a bank it does not need just cause to evict you. But you still have the right to a court hearing where you can defend against the eviction.