Make the most of your home sale and home purchase by deducting the maximum amount of the expenses on your taxes.  Make sure you work with a good tax adviser and keep good records.  By educating your self, you can ask the right questions and provide the necessary documentation to take advantage of your available deductions.
This is a pretty comprehensive article on deductions for home sellers and home owners.  ALWAYS check with your tax adviser to make sure your are in compliance.
This comprehensive article also covers a broad range of tax deductions and strategies for home sellers and homeowners.