Upvote:7
If your visa is still valid, there's no rule saying you have to spend any particular time outside the US before you use it again.
However, border guards will (as always) be able to deny you entry even though you have a visa, if they don't believe that you're actually intending to be a tourist. A stay of five months followed by another entry attempt less than that length afterwards is probably going to raise suspicion that you're actually going to the US to work or otherwise build a life there. In particular, since you're not allowed to work on a B1/B2 visa, the officers at the border will be interested in knowing how you afford being a tourist for such long, and repeated, stretches of time. So you should have a good and convincing explanation of that ready when you try to enter again, preferably backed with concrete documentation.