A key challenge in the field of nanotechnology, in particular in the design of molecular machines, novel materials or molecular electronics, is the bottom-up construction of covalently bound molecular architectures in a well-defined arrangement. To date, only rather simple structures have been obtained because of the limitation of one-step connection processes. Indeed, for the formation of sophisticated structures, step-by-step connection of molecules is required. Here, we present a strategy for the covalent connection of molecules in a hierarchical manner by the selective and sequential activation of specific sites, thereby generating species with a programmed reactivity. This approach leads to improved network quality and enables the fabrication of heterogeneous architectures with high selectivity. Furthermore, substrate-directed growth and a preferred orientation of the molecular nanostructures are achieved on an anisotropic surface. The demonstrated control over reactivity and diffusion during covalent bond formation constitutes a promising route towards the creation of sophisticated multi-component molecular nanostructures.