This answer to this question is mostly a matter of the marriage license being valid, however it may also involve ensuring that the officiant has completed any required government registration. Let's start with officiant registration and then move onto the marriage license.
Before officiating any weddings, you need to make sure that you have observed any required officiant registration requirements in your State, County, City, or Town.
Lucky for you, we have an entire section of our site dedicated to officiant government registration. On this page you can find out if you need to register as an officiant in the state where you will be performing marriage.
Alternatively, the list below links to all the States and Territories where you are required to register with a government office as a wedding officiant.
If you are planning on performing marriage in any of these places, you must first register with a government office.
The second part to this questions involves the marriage license. For a marriage to be legal in the eyes of the government, the couple must first file for a marriage license. That marriage license must be completed and returned within a specific timeframe in a manner specified by the marriage license issuance office.
Once the completed marriage license is returned to its issuance office, that office will make a copy of the license and file the original with a state level government office.
In most states, this is the Department of Health or Bureau of Vital Statistics. Further confirmation of the legal status of the marriage will be delivered to the couple (and sometimes to the officiant) by that State level government office.
A few weeks after the wedding, the couple should receive a certified copy of the marriage license. That certified marriage license copy is proof that the marriage is legal.