If you were here on an R-2, you were never a "LEGAL IMMIGRANT." You may have been legally present, but R-2 is an nonimmigrant visa.

You can marry your girlfriend, immigration status doesn't affect the ability to marry.
Of course, marriage isn't going to help your immigration status.

Being denied a green card doesn't make one illegal. What happened to your R-2 status (assuming since you're not married yet, you came here under the auspices of a parent's R-1 visa)?

Why was your green card application denied?

Your best bet would be to search out an immigration attorney who can ferret out the details that you are omitting.