Well, that's 183 days according to the IRS. Here is the link:
But the other problem is that you should not think that you are safe just because you are getting paid from an outside source. You are not supposed to be working while physically present in the U.S. Take a look at the B-1 business visa chart:
Even while on an ESTA, if your activity does not fit into that chart, you could get into trouble.
And if you are staying 3 months, leaving for a month then coming back, then staying for another 3 months, then leaving again for a month to come back for 3 more months, you may get away with it 2 or 3 times, but at some point they will make a determination that you are living in the U.S. As I said, you are supposed to be spending more time outside of the U.S. than inside of the U.S. So better one month in, 3 months out, etc.
Let me know if you need anything else, but please do not forget to rate me positively. You can do that by clicking on the 3rd, 4th or 5th stars if you see them, or the smiley faces if you see them. If you do not see the stars or smiley faces, please click on my name and they should come out. Also, we do NOT finish just because it says "Rate to Finish" or something like that. Your question does NOT close and you can continue to ask questions without additional charge on the same question thread even after you leave a positive rating. Thank you for your understanding!