IF they were "legal immigrants," they would have green cards. Illegal aliens often attempt various ruses, e.g. marriage to a citizen, in attempt to get a green card. If they are "trying to get a green card," chances are very high that they are illegal aliens, trying to scam the system.
Another group who are NOT "legal immigrants" but who are trying to get green cards are people who applied for and entered on temporary visas, e.g. student visas. A very high percentage of foreign students in the US commit visa fraud, applying for temporary visa when they intend to remain permanently. Once again, marriage fraud is a common way to attempt to get a green card, but they committed felony fraud in getting a temporary visa to begin with.