I don't know if it was legal or not. I suggest you speak with an attorney. If you were renting it from someone,you're entitled to a 90 grace period in the property before you can be evicted. If you were the owner, you might want to contact the court. You obviously are missing some information. Foreclosures can take 2 years or longer to be concluded.