While some countries like those of the Schengen Area have a very explicit 90/180 rule, the situation in the US is different.
There is no such thing as a “90 day rule” in the US.
There is however a rule that you should not use non-immigrant visas (like B1/B2) or visa waivers (when you used your ESTA you actually entered the US under the VWP, the Visa Waiver Program) to live in the US through frequent or repeated visits (I believe that’s the UK wording but the US rule is similar).
There is no hard and fast rule. You won’t be automatically rejected because you exceeded some count by a day (as could happen in Schengen). You could very well leave the US and come back the next day. But both consular officers and CBP officers will try to determine whether you are attempting to live in the US.
The usual rule of thumb is that you should spend at least as much time out as you spend in the US. Whether this is measured per trip, per 6 months, per sliding year, per calendar year is not defined. It’s up to them to decide.
Spending 3 months in the US then coming back for 6 months shortly after is just a no-no, whatever the means.
Also remember that if you spend more than half of a year in the US, you are likely to become a tax resident. And of course your home country will probably continue to consider you their tax resident. Nastiness ensues.
More importantly, on any entry into the US, you have to overcome immigrant intent. Consular and CBP officers have to consider that you want to immigrate until they are convinced that you do not.
Spending 9 months in the US wreaks havoc in your argument. How can you live in the US for 9 months without working? What are your ties to your home country which give you a reason to go back? Why would you leave? Will you leave? Will you not work in the US?
We do not know your circumstances, but I would be a consular or CBP officer, you would get a neat refusal right away. And those things stick. Like superglue. You don’t want that on your file.