Forclosure and eviction are two different things.
Usuaually they are thought of one being for owning and one being for renting however eviction is just a process just like forclosure.
Forclosure (as you pretty much know) is the process that the bank (or another debtor that has the right - lein on the property) to take over legal ownership of the house to repay the debt in lieu of a breach in the contract. Forclosure doesn't mean you can't live in the house. just means the bank owns it now - or put it up for sale and someone else owns it.
Eviction is the legal process of getting a judegement to have someone removed from a property in which they are not the legal owners of for either a breach of contract or other things.
Now usually eviction is used for renters who don't pay or break some rules etc. HOWEVER eviction is also used after forclosure if the person refuses to leave the property. A bank will have the sale and either they will own it or someone else will have bought it at the auction. This new owner/bank can then file for an eviction if the previous owners are still living there. They have the legal right to have you evicted since there was no contract for rent and no rent was paid - aka the previous
owners are squatters. These rules obviously vary by state but the gist is the same.
Now what probably happened was the forclosure happened. you moved either before or after the sale (doesn't really matter) and when the bank (or whomever bought it at the auction) showed up to change the locks and take possession of the property they found your husband there (and perhaps at the time you were still living there as well). They then would have filed and started the eviction process which is pretty straightforward in these cases and usually the previous owner doesn't have a leg to stand on and a judgement would have been passed without you even knowing most likely.
Do your homework. Find proof of when you moved out - do you have proof with a new lease or something showing a new address? and find out when the forclosure happened - call the bank, they'll tell you or call a records office for your town/county/etc. Then find out when the eviction judgement passed.
You probably won't be able to get it removed from the court system since you obviously didn't show up so thus a deafult judgement would have been made but you could probably get it removed if you disputed it and had proof you were gone prior to the eviction and that it was just your exhusband taht was evicted.