You must be a lawful permanent resident for at least five years (three if married to a US citizen), be a resident in the state where you apply for at least 90 days prior to applying, be physically present in the US for 2.5 years aggregate of the five years before you apply, and have good moral character.