(a) As used in this section, the term nonresident of Alabama shall include individuals, trusts, partnerships, corporations, and unincorporated organizations. Any seller or transferor who meets all of the following conditions and who provides the buyer or transferee with an affidavit signed under oath swearing or affirming that all of the following conditions are met will be deemed a resident for purposes of this section:
(1) The seller or transferor has filed Alabama income tax returns or appropriate extensions have been received for the two income tax years immediately preceding the year of sale.
(2) The seller or transferor is in business in Alabama and will continue substantially the same business in Alabama after the sale or the seller or transferor has real property remaining in the state at the time of closing of equal or greater value than the withholding tax liability as measured by the 100 percent property tax assessment of such remaining property.
(3) The seller or transferor will report the sale on an Alabama income tax return for the current year and file it by the due date.
(4) If the seller or transferor is a corporation or limited partnership, it is registered to do business in Alabama.
(b)(1) Except as otherwise provided in this section, in the case of any sale or transfer of real property and related tangible personal property located in Alabama by a nonresident of Alabama, the buyer or transferee shall be required to withhold and remit to the Commissioner of Revenue on forms provided by the commissioner a withholding tax for individual buyers or transferees equal to three percent of the purchase price or consideration paid for the sale or transfer, and for corporate, partnership, or unincorporated association buyers or transferees equal to four percent of the purchase price or consideration paid for the sale or transfer; provided, however, that if the amount required to be withheld pursuant to this subsection exceeds the net proceeds payable to the seller or transferor, the buyer or transferee shall withhold and pay over to the commissioner only the net proceeds otherwise payable to the seller or transferor. Any buyer or transferee who fails to withhold such amount shall be personally liable for the amount of the tax.
(2) The liability imposed by this subsection shall be paid upon notice and demand by the commissioner or the commissioner's delegate and shall be assessed and collected in the same manner as all other withholding taxes imposed by this article.
(c) If the seller or transferor determines that the amount required to be withheld pursuant to subdivision (1) of subsection (b) will result in excess withholding on any gain required to be recognized from the sale, the seller or transferor may provide the buyer or transferee with an affidavit signed under oath swearing or affirming to the amount of the gain required to be recognized from the sale, and any individual buyer or transferee shall withhold three percent of the amount of the gain required to be recognized, if any, and the corporate, partnership, or unincorporated association buyers or transferee shall withhold four percent of the amount of the gain required to be recognized, if any, stated in the affidavit rather than as provided in subdivision (1) of subsection (b). If, however, the amount required to be withheld pursuant to this subsection exceeds the net proceeds payable to the seller or transferor, the buyer or transferee shall withhold and pay over to the commissioner only the net proceeds otherwise payable to the seller or transferor.
(d) Subsection (b) shall not apply where any of the following occur:
(1) The real property being sold or transferred is a principal residence of the seller or transferor within the meaning of Section 121 of the Internal Revenue Code.
(2) The seller or transferor is a mortgagor conveying the mortgaged property to a mortgagee in foreclosure or in a transfer in lieu of foreclosure with no additional consideration.
(3) The transferor or transferee is an agency or authority of the United States of America, an agency or authority of the State of Alabama, the Federal National Mortgage Association, the Federal Home Loan Mortgage Corporation, or the Government National Mortgage Association, or a private mortgage insurance company.
The commissioner may by rule set a purchase price amount below which no withholding is required.
(e)(1) Unless otherwise provided, if the seller or transferor is a partnership or Subchapter "S" corporation or other unincorporated organization which certifies to the buyer or transferee that a composite return is being filed on behalf of the nonresident partners, shareholders, or members and that the partnership, Subchapter "S" corporation, or unincorporated organization remits the tax on the gain on behalf of the nonresident partners, shareholders, or members, the buyer or transferee shall not be required to withhold as provided in this section. Any nonresident partner, shareholder, or member who falsely certifies that a composite return is being filed on behalf of such partner, shareholder, or member shall be liable for a penalty in the amount of five hundred dollars ($500) or 10 percent of the amount required to be withheld, whichever is greater.
(2) The penalty imposed by this subsection shall be paid upon notice and demand by the commissioner or the commissioner's delegate and shall be assessed and collected in the same manner as the withholding tax imposed by this article.
(f) Every buyer or transferee of real property located in Alabama who is required to deduct and withhold the withholding tax imposed by subsection (b) shall file the required return and remit payment to the Department of Revenue on or before the last day of the calendar month following the calendar month within which the sale or transfer giving rise to the withholding tax occurred.