Investors & landlords

You would owe tax on the capital gain. There is no tax exemption for using the proceeds to buy another home.