Actually, you can.
The Tax Cuts and Jobs Act introduced the Section 1400Z-1 Qualified Opportunity Zones, where you can permanently exclude gains from sale of stock if you invest those gains within 180 days in an opportunity zone for 10 years.
[https://www.irs.gov/credits-deductions/opportunity-zones-frequently-asked-questions](https://www.irs.gov/credits-deductions/opportunity-zones-frequently-asked-questions)
Latest Answers