Complexes are basically a collection of prepared and secured modules that have been specialised. These alter the ecology of the planet, reducing the ratio of domes per complex over time.
Terraforming complexes use a number of techniques to stabilise a planetary atmosphere, making it suitable to breathe.
They use various strains of genetically engineered bacteria to remove unwanted gases or produce more of a certain gas. They use enzymes and inorganic catalysts to increase natural reactions. They can also spin huge polymer shield reflectors or produce dust clouds in the stratosphere to change light levels.
Generally speaking though completion of terraforming will only make a planet habitable for a century or so unless a planet was already in the process of becoming breathable.
Domes, caves, command, mines, hiports, orbital docks, terraforming and bunkers do not count towards enclosed space requirement.