Buildings 20,000 square feet or larger will have to eliminate carbon emissions by 2050 under a new rule, adding Boston to a growing number of cities considering regulations to aggressively reduce their building-sector emissions.