It’s not necessarily that simple. If your electricity comes primarily from renewable sources such as hydro, then it’s definitely true that electric heat is more carbon-friendly than fossil-fuel heat. But if your electricity comes from a fossil fuel source, then there’s the complication that the power plant is losing some of the energy of the fuel as waste heat, but heat produced from burning in your furnace isn’t wasted: This could tip the scales to favor an in-house furnace. Or maybe the power plant is a cogeneration plant, and also makes some use of the waste heat. And then there’s the matter that not all fossil fuels are equal for CO2 production: Most modern fossil-fuel furnaces burn methane, the cleanest of the fossil fuels, while most power plants burn coal, the dirtiest.
In short, which form of home heating is greener depends both on the sorts of power plants used locally, and on the local temperatures.