Addressing high capacity at low power as a key design goal envisages achieving high spectral efficiency (SE) and energy efficiency (EE) for the next-generation mobile networks. Because most data are generated in indoor environments, an ultra-dense deployment of small cells (SCs), particularly within multistory buildings in urban areas, is revealed as an effective technique to improve SE and EE by numerous studies. In this paper, we present a framework exploiting the four most interconnected-domain, including, power, time, frequency, and space, in the perspectives of SE and EE. Unlike existing literature, the framework takes advantage of higher degrees of freedom to maximize SE and EE using in-building SCs for 5G and beyond mobile networks. We derive average capacity, SE, and EE metrics, along with defining the condition for optimality of SE and EE and developing an algorithm for the framework. An extensive system-level evaluation is performed to show the impact of each domain on SE and EE. It is shown that employing multiband enabled SC base stations (SBSs) to increase operating spectrum in frequency-domain, reusing spectrum to SBSs more than once per building in spatial-domain, switching on and off each in-building SBS based on traffic availability to reduce SBS power consumption in power-domain, and using eICIC to avoid co-channel interference due to sharing spectrum with SBSs in time-domain can achieve massive SE and EE. Finally, we show that the proposed framework can satisfy SE, EE, as well as user experience data rate requirements for 5G and beyond mobile networks.