This is backwards. Such a tax will be a strong incentive to never ever sell since the seller would hand off all gains to the tax man. Who would want to sell?
Instead, you'd want to actually incentivize selling if you're not living on the property. Make the capital gain tax very low, that makes selling it off the most attractive option.