Assuming you never overstayed before or worked here, you should be ok if you get married to the US citizen & adjust your status in the US. Make sure you consult with an immigration atty before filing docs with USCIS.
You said "...we are considering getting married so I could maybe get a green card and work in the us". It is immigration fraud to marry someone for the purpose of circumventing U.S. immigration law. It is imperative that you contact an immigration lawyer, whether myself or one of my colleagues. If you fail to obtain legal assistance RIGHT NOW, you may cause huge problems for yourself. (In fact, you will desperately wish that you could travel back in time and fork over your life's savings just to consult an immigration lawyer). If you appreciate the time spent preparing this answer, kindly consider marking it BEST ANSWER or HELPFUL. Also, please be sure to read my disclaimer below. Good luck to you.
Dean P. Murray
The Murray Law Firm
560 Sylvan Avenue
Englewood Cliffs, NJ 07632
Mr. Murray's response is NOT legal advice and does NOT create an attorney-client relationship. You should NOT rely on this response. Mr. Murray's response was generated without conducting a full inquiry as would occur during a face to face attorney-client consultation. It is likely that the response above may be made less accurate, or become entirely inaccurate, as you, i.e. the questioner, disclose additional facts that should only be discussed during a private consultation with an attorney. I strongly recommend that you consult an attorney who is licensed to practice law in your state (or, in the case of immigration law, and attorney in ANY state), whereupon all relevant facts will be discussed. All responses posted by Mr. Murray on Avvo.com are intended as general information for the education of the public, and not for any specific individual.
You have a couple of options. You can marry your boyfriend and he file a petition for you and you apply for adjustment of status. Or if you go back to your country he can file a fiancee visa. What I would not recommend is for you to continue your current courst of action (spending 6 months in the US, and then traveling abroad and coming for another 6 months) since they could deny your entry at any of those time, and get a five year bar in which you cannot reenter the US.