; and (D) by inserting after subparagraph (C) the following: (D) Farm viability and local climate resiliency Of the funds made available to carry out this section for a fiscal year, 10 percent shall be used to provide grants under subsection (f). . 402. Organic certification cost-share program Section 10606(b)(2) of the Farm Security and Rural Investment Act of 2002 ( 7 U.S.C. 6523(b)(2) ) is amended by striking $750 and inserting $1,000 . 403. Exclusion of gain from sale of certain farm property and agricultural easements (a) In general Part III of subchapter B of chapter 1 of the Internal Revenue Code of 1986 is amended by adding after section 121 the following new sections: 121A. Exclusion of gain from sale of qualified farm property (a) Exclusion Gross income shall not include gain from the sale or exchange of qualified farm property if such property is sold to or exchanged with a transferee who— (1) is a qualified farmer, and (2) meets the certification requirement of subsection (c). (b) Limitation (1) In general The amount of gain excluded from gross income under subsection (a) with respect to any taxable year shall not exceed the excess, if any of— (A) $500,000 ($1,000,000 in the case of a joint return), over (B) the amount excluded from the gross income of the taxpayer for all prior taxable years. (2) Special rule for joint returns The amount of the exclusion under subsection (a) on a joint return for any taxable year shall be allocated equally between the spouses for purposes of applying the limitation under paragraph (1) for any succeeding taxable year. (c) Certification requirement A qualified farmer meets the certification requirement of this subsection if such person signs a written certification stating the following: (1) Use certification as farm for farming purposes The use of such property will be as a farm for farming purposes at all times during the recapture period. (2) Recapture agreement The transferee has been notified of the recapture liability arising from a disposition or change in the