Divorce is never automatic so it doesn't matter if you've been separated and not living together for 5 years or 100 years you would still be legally married and not divorced.
To get a divorce you must file divorce papers through court and have the spouse be served with divorce papers and they must sign those divorce papers before the divorce is finalized.
Until those divorce papers are served and signed you will still be married to the person and cannot legally get married again until the divorce is over with.
You have to go to court and hope that the spouse signs the divorce documents without any issue and if not then you need to get a divorce lawyer involved to help you get an uncontested divorce.
Some states may also force you to go to marriage counseling first before you get divorced and you usually have to be married at least 1 or 2 years before you can get divorced depending on the state.
Always think it through before getting married to someone as it's a huge commitment and you could end up having to pay alimony to the spouse if you're a husband and it could last the former wife's lifetime.