I just thought I would put in another answer, which absolutely directly answers what the OP is asking:
Does a Canadian need a visa to volunteer in Hawaii?
Answer: You cannot do this.
(Note - it's unfortunately misguided asking if you "need a visa", if you applied for one it would be instantly denied.)
In exceptionally limited circumstances, completely unrelated to everything you have described, visitors to the US can "volunteer" in situations such as floods, storms etc.
A friend wants to work on a farm
Answer: He cannot do this.
In exchange for the work
Answer: He cannot do this.
he will get meals and accommodation
Answer: He cannot do this.
Are these meals and accommodation considered payment
Yes.
Can it be considered a cultural exchange
"Cultural exchange" is utterly unrelated to anything mentioned here.
Purely FWIW, it is all-but impossible to get a Q visa ("cultural exchange") and note that you, a human, can't get one. Only businesses can get Q visas, on behalf of humans.
does he need a visa (for the scheme mentioned)
No visa of any type is available for the scheme mentioned.
Sorry for the incredibly bad news! :)
As everyone will say. Zillions of people a year visit the US in "gray areas". For example
the most common question on this site is "When I visit the US as a tourist, can I in fact work remotely on my laptop". The answer is incredibly simple, "NO". There are no ifs ands or buts. You can NOT do that. BUT literally millions of people do that ever year.
people ask things like "If I take photos in the US while a tourist, can I sell the photos". Answer is NO. But again hordes of people do this.
And so on.
So sure, vast hordes of people in this situation would simply say at the border (if even asked) "visiting friends" or just "holiday" and go their way. But be aware that border agents are extremely smart and experienced, the slightest whiff and you're done. There's zero debate, discussion.
Best of luck! Sorry for the bad news.
For "four months" ...
I've actually only now noticed OP mentions "for four months". It's really difficult to merely get tourism rights for "four months". wtt xngtng Canadians can in fact usually get up to six months tourism arranged in the US, so again assuming you're going to, well, lie "like everyone else" and just say it's tourism, should be achievable.
H2-A visa
As pointed out by MichaelS. There is an incredibly slim chance it could be done with a H2-A visa. Apart from anything else note that these take ~6 months to get and FWIW cost a couple hundred bucks. You'd also be, well, lying because it's inconceivable there's a specific labour shortage in question. (Might as well simply ... "arrive as a tourist and lie".) Generally H2-A are for well-known seasonal regional things, example, a well-known grape harvest month in region X. You'd have to convince the authorities that there's a sudden annual need for workers of type T in county C at XYZ time of year! But yes, MichaelS is right, you could theoretically do this.