How can an illegal immigrant obtain legal status in the US?

Unless the unlawfully present person qualifies under asylee or refugee status he or she cannot apply for legal status within the US. The person must voluntarily leave the US or be deported. A foreign national who has resided unlawfully within the US for at least 12 months is subject to deportation and barred from applying for reentry for 3 years. A foreign national who has resided unlawfully within the US for more than 12 months is subject to deportation and barred from applying for reentry for 10 years.