Check with a CPA certified for your state. The regulations on what constitutes a farm really vary quite a bit state-to-state.
In my state, you have to sell your products commercially before you're considered a farm, although you don't actually have to make any money by doing so (farmers who are running a deficit are still farmers). However, the state assigns the responsibility for Board of Health certification to individual towns/cities rather than the state government, and gosh, those town inspectors have absolutely no sense of humor. The state just comes round once a year to inspect and shoot the breeze for a bit, it's the town busybodies who decide whether you're clean enough to sell at the market, so essentially my neighbors get to decide if I'm a farm. Too bad for me, they just think I am somewhat nuts. :pinkelephant:
However, I know some other states require certain amounts of income derived from farm activities before you're a "real" farm. Had one dude from St. Louis inform me that because I don't make at least $30k/year off my poultry & fruit, I am not a "real" farmer. I said, gee, I know plenty of farmers who are in debt up to their eyeballs and not making a thin dime after they pay for diesel, seed, tractor repairs, fertilizer, pesticide, milker maintenance, tank chillers, antibiotics, water tanks, concrete...you want to tell them they ain't real farmers? :-P