Be a lawful permanent resident (or Green Card holder) for at least five years, or three years if married to a U.S. citizen.
As to the X gender option: Supporting documentation is not required to request or change the gender selection on the N-400. Gender selection on the Form N-400 does not need to match other immigration ...