If one sells a commercial property, can tax be saved by investing in a residential property?

Someone can purchase a residential property from a commercial property’s selling proceeds to save taxes on the capital gain.