The U.S. Dept of Energy (DOE) created a common vocabulary and definitions of "Zero Energy Building". (Original 2015 release of "common Definition"). This has been adopted in the 2021 IECC (International Energy Code), which issued "Zero Code" appendices, available for adoption by code-creating authorities, in new and rehab residential and commercial buildings.
REFERENCES: overview: Zero Energy Building definitions (includes multiple subsections).

Generally speaking, a zero energy building produces enough renewable energy to meet its own annual energy consumption requirements, thereby reducing the use of nonrenewable energy in the building sector.

The official definition of Zero Energy Building (ZEB): "An energy-efficient building where, on a source energy basis, the actual annual delivered energy is less than or equal to the on-site renewabl exported energy". Terms in bold are defined in the “Nomenclature” section of the "Definitions" document, above
NOTE: The focus is on energy use of a building, not the carbon emissions from its energy use. HENCE, a
zero-energy building may still have significant carbon emissions if it utilizes fossil fuels (including natural gas) for space heating, water heating, cooking, or clothes drying.

(A "Zero Carbon Building" could be a "Zero Energy Building", but with added restrictions on use of fossil fuels).