Help w/Cap Gains Taxes on Rental Property
1997 - purchased home A for $98,000 as primary residence
2001 - Refi $20k home loan for improvements
2005 - Refi $40k home loan for improvements
2008 - moved to new primary (home B) and rented out home A, refinanced and borrowed $130k against A for down payment on home B
2015 - Refinanced and borrowed $100k against home A for student loans
2017 - selling for $658k, existing mortgage balance $400k
Went to a CPA who somehow subtracted about $400k from the home A sales price which greatly lowered cap gains tax, is this allowed and correct? Any other advice?