You can have been married and divorced multiple times. You can’t be currently married prior to age sixty and collect survivor benefits on your deceased spouse or spouses.
If you divorced your deceased spouse, got remarried, and then your second spouse died, you’d draw survivor benefits on the higher of the two records. You’d have to have been married for ten years or more to the first spouse. You would only have to have been married to your second spouse for nine months at the time of death.