Two IRS publications address the issue of tax on sale of the marital home:
IRS Publication 504: Divorced or Separated Individuals
The following is excerpted from Publication 504:
Sale of Jointly-Owned Property
If you sell property that you and your spouse own jointly, you must report your share of the recognized gain or loss on your income tax return for the year of the sale. Your share of the gain or loss is determined by your state law governing ownership of property. For information on reporting gain or loss, see Publication 544.
Sale of home. If you sold your main home, you may be able to exclude up to $250,000 (up to $500,000 if you and your spouse file a joint return) of gain on the sale. For more information, see Publication 523, Selling Your Home (below).
Costs of Getting a Divorce
You cannot deduct legal fees and court costs for getting a divorce. But you may be able to deduct legal fees paid for tax advice in connection with a divorce and legal fees to get alimony. In addition, you may be able to deduct fees you pay to appraisers, actuaries, and accountants for services in determining your correct tax or in helping to get alimony.