Get your taxes done using TurboTax

you would pay tax on the $50,000 gain, because you bought AND SOLD the stock.  

 

Any tax on the $20,000 stock you bought is not due until you SOLD the stock and would be calculated only after the stock was sold and the gain / loss could be calculated.