When you bought your home, you may have paid settlement fees or closing costs in addition to the contract price of the property. Generally speaking, closing costs are not allowable as a deduction on your return. They are an increase in your basis or cost of the property to you. When you sell the property your basis may be adjusted which results in a smaller gain on the sale of the property.
An exception to this may be related to points (discount points or loan origination fees) paid at closing. In the Q&A for Itemized Deductions there is a specific interview that will assist you with determining if your points are deductible and over what period of time they are deductible.
Deductible fees are limited to home mortgage interest, mortgage insurance premiums, and certain real estate taxes, which are itemized deductions on Schedule A.
Per IRS Publication 17 Your Federal Income Tax (For Individuals), pages 100-101:
Settlement costs. Your basis includes the settlement fees and closing costs you paid for buying the property. (A fee for buying property is a cost that must be paid even if you buy the property for cash.) Don't include fees and costs for getting a loan on the property in your basis.
The following are some of the settlement fees or closing costs you can include in the basis of your property:
Settlement costs do not include amounts placed in escrow for the future payment of items such as taxes and insurance.
The following are some of the settlement fees and closing costs you cannot include in the basis of property.
Real estate taxes. If you pay real estate taxes the seller owed on real property you bought, and the seller didn't reimburse you, treat those taxes as part of your basis. You can't deduct the taxes as an expense.
If you reimburse the seller for taxes the seller paid for you, you can usually deduct that amount as an expense in the year of purchase. Don't include the amount of real estate taxes you deducted as an expense in the basis of your property. If you didn't reimburse the seller, you must reduce your basis by the amount of those taxes.
For additional information, please see the following publications: