Under current law, if you are in the US without status or out of status, you generally cannot get the green card.
In order to be able to get the green card in the US despite being out of status – meaning you entered with a valid visa but overstayed – you would only be able to get the green card if you married a US Citizen or you qualified for 245(i).
If you entered the US without inspection (illegally), then the only way you could get the green card in the US is if you qualify for 245(i), or to process outside the US after obtaining a waiver for the applicable bar based on extreme hardship to a US citizen or legal permanent resident spouse or child.
Obtaining a waiver of the applicable bars is difficult, and should be applied for with an attorney.
Our Los Angeles Immigration Lawyers are available to assist you.