Deductions & credits

I've been told but cannot confirm that one can take into account the cost of buying a new house when reporting the taxable amount for selling the old house.   (e.g. you downsize and sell a house for $700,000 and buy a house for $350,000 - does this impact anything regarding the taxable treatment of the sell?)