In the United States, a marriage is legal when you apply with the government and have a ceremony that follows certain rules.
In Minnesota you apply for a marriage license with the county. After getting the license, you have to be married by an authorized person. Then you get your marriage certificate from the county.
If you get married by an authorized person, following the rules of your religion but DID NOT get a license, you might not be legally married in Minnesota.
Generally, a divorce is not valid unless the couple goes to court. Papers are filed with the court and typically the couple must meet with a judge. The judge then signs a form that says you are divorced.
Because each state has different laws, the marriage or divorce must follow the laws of the state where the ceremony or divorce happened.