Investors & landlords

How does the transaction get recorded in the final box?  Does it calculate the sale as the difference between the inherited cost and current cost?  So if the stock is worth $20 more per share then the inherited date, do you only pay taxes on the $20 per share?  How does it calculate as gain/loss?