All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
If the expression used by your husband is an explicit wording of divorce such as “you are divorced”, “I divorce you”, etc. then the divorce is legally effective even if he did not mean to issue divorce.
If this divorce is the third one, then you become forbidden for him. Consequently, he cannot marry you unless you marry another man, fulfilling all the conditions of a valid marriage. After having sex with the new husband at the time when you are pure, if he divorces you voluntarily then the previous husband can marry you with a new marriage contract; i.e., fulfilling all the conditions of a valid marriage.
As far as the matter of ‘Iddah (waiting period) is concerned, it is three menses if you still have regular monthly periods even if the husband does not have sexual intercourse for years.
Allah knows best.