Personal residence sales. I lived in a townhome from June 2013 till Dec 2018. Now I am selling townhome to get tax free gains. How the new tax laws affect my situation?

There are substantial gains I am expecting. Do I need to hold it for 5 years according to new tax laws for the gains to be tax free?