Unless your someone filed a petition or labor certification for your boyfriend prior to April 30, 2001, your marriage to him will not cure his immigration status issue. (Unless he qualifies for Cancellation of Removal).
Based on the facts presented, the best avenue would be to get married, file the anchor petition and then leave the U.S. It is important to note that your boyfriend is inadmissible based on his unlawful entry. Once he leaves, he cannot return until either ten years have elapsed or he is granted a waiver for his transgression. The burden on the waiver is very high.
Prior to doing anything, you must consult with an experienced immigration attorney who practices in consular processing and waivers.Ask a similar question