Do I Have to Pay Tax after Selling my Second House and Pay for the First House?

I have owned two houses. I am about to sell my second house, which has been my primary residence for more than five years. I plan to use the $50,000 earnings from this sale to pay for my first house, which has been rented. At the end of the year, do I have to pay tax on the $50,000 earnings?