If you get a B2 Visa to visit USA, and then get engaged/married, what is your next step?

So I am going to see my boyfriend very soon. He wants me to move with him and live there with him (which I want to do because I want to be with him). However the process is very long and difficult. We are very serious about each other, and he has spoken about marrying me. If I was to go there, and he decides to marry me while I am there, what is my next step? Would I have to return to my home country, then apply for a k2 visa? Or will I be able to go to the American embassy there (if that is where I am meant to report to?), and let them know of the marriage? Would they require me to go back to my home country, and then come back? Or would they allow me to stay? Please help, I need a better understanding of this.
If you get a B2 Visa to visit USA, and then get engaged/married, what is your next step?
Post Opinion