Calculating capital gains for primary home converted to rental property - land value in cost basis

We have a home that was our primary home for 2 out of the last 5 years. 2 years ago we put the house up for rental and we are considering selling it now. So the house qualifies for the 500k capital gains deduction as a joint return.

 

my question is about calculating the capital gains on the house. 

The house was purchased for 400k. We made 40k of improvements before putting it up for rent. 

when our taxes were filed 2 years ago at the start of the rental, we used 300k as the costs basis (100k land value was deduced) and reported that as the cost basis to the IRS. 

I now know I made a mistake by not including the 40k in improvements. My understanding is that the only way to correct it is to go back and file a 1040x for the last 2 years to correct the costs basis and depreciation for that 40k. My first question is, can I do it through Turbo Tax myself without a CPA? Am trying to figure out how much tax would I save by doing it?

 

the second question, what happens to the 100k in land value that I deducted from the purchase price while calculating my costs basis?

 

im trying to figure out if we are selling our house for 900k, that represents a 500k gain from the purchase price and that should be tax free based on the joint couple returns exclusion from the IRS. 

However my costs basis declared to the IRS is 300k.

1. How do I calculate my net capital gains so the I know how much tax should be withheld at closing?

2. and more importantly how do I tell the IRS about it ? Is the 100k land value lost or is there a way to report it to the IRS even though my cost basis reported at the beginning was 300k?