The Taxpayer Relief Act of 1997 (TRA97) significantly changed the tax treatment of housing capital gains in the United States. Before 1997, homeowners were subject to capital gains taxation when they sold their houses unless they purchased replacement homes of equal or greater value. Since 1997, homeowners can exclude capital gains of $500,000 (or $250,000 for single filers) when they sell their houses. Such dramatic changes provide a good opportunity to study the lock-in effect of capital gains taxation on home sales. Using 1982–2008 transaction data on single-family houses in 16 affluent towns within the Boston metropolitan area, I find that TRA97 reversed the lock-in effect of capital gains taxes on houses with low and moderate capital gains. Specifically, the semiannual sales rate of houses with positive gains up to $500,000 increased by 0.40–0.62 percentage points after TRA97, representing a 19–24% increase from the pre-TRA97 baseline sales rate. In contrast, I do not find TRA97 to have a significant effect on houses with gains above $500,000. Moreover, the short-term effect of TRA97 is much larger than the long-term effect, suggesting that many previously locked-in homeowners took advantage of the exclusions immediately after TRA97. In addition, I exploit the 2001 and 2003 legislative changes in the capital gains tax rate to estimate the tax elasticity of home sales during the post-TRA97 period. The estimation results suggest that a $10,000 increase in capital gains taxes reduces the semiannual home sales rate by about 0.1–0.2 percentage points, or 6–13% from the post-TRA97 average sales rate.