The installation and operation distributed energy resources (DER) and the electrification of the heat supply significantly changes the interaction of the residential building stock with the grid infrastructure. Evaluating the mass deployment of DER at the national level would require analyzing millions of individual buildings, entailing significant computational burden. To overcome this, this work proposes a novel bottom-up model that consists of an aggregation algorithm to create a spatially distributed set of typical residential buildings from census data. Each typical building is then optimized with a Mixed-Integer Linear Program to derive its cost optimal technology adoption and operation, determining its changing grid load in future scenarios. The model is validated for Germany, with 200 typical buildings considered to sufficiently represent the diversity of the residential building stock. In a future scenario for 2050, photovoltaic and heat pumps are predicted to be the most economically and ecologically robust supply solutions for the different building types. Nevertheless, their electricity generation and demand temporally do not match, resulting in a doubling of the peak electricity grid load in the rural areas during the winter. The urban areas can compensate this with efficient co-generation units, which are not cost-efficient in the rural areas.