If he entered the U.S. legally, he may be able to adjust his status after marriage and regain legal status. But if he leaves, he may be subject to a lengthy period of exclusion for his period of unlawful presence in the U.S.

If he didn't enter legally, he can't adjust his status (as he had no status in the first place).