(a) Any tax due under this chapter on a gain realized on a forced sale pursuant to foreclosure of a mortgage or other security interest in agricultural production property, other real property, or equipment, used in a farm business that was owned and operated by the taxpayer shall be a dischargeable debt in a bankruptcy proceeding under United States Code, title 11, section 727.
(b) Income realized on a sale or exchange of agricultural production property, other real property, or equipment, used in a farm business that was owned and operated by the taxpayer shall be exempt from taxation under this chapter, if the taxpayer was insolvent at the time of the sale and the proceeds of the sale were used solely to discharge indebtedness secured by a mortgage, lien, or other security interest on the property sold. For purposes of this section, "insolvent" means insolvent as defined in section 108(d)(3) of the Internal Revenue Code. This paragraph applies only to the extent that the gain is includable in federal taxable income or in the computation of the alternative minimum taxable income under section 290.091 for purposes of the alternative minimum tax. The amount of the exemption is limited to the excess of the taxpayer's (1) liabilities over (2) the total assets and any exclusion claimed under section 108 of the Internal Revenue Code determined immediately before application of this paragraph.
(c) For purposes of this section, any tax due under this chapter specifically includes, but is not limited to, tax imposed under sections 290.02 and 290.03 on income derived from a sale or exchange, whether constituting gain, discharge of indebtedness or recapture of depreciation deductions, or the alternative minimum tax imposed under section 290.091.