In today’s world, a significant amount of global energy is used in buildings. Unfortunately, a lot of this energy is wasted, because electrical appliances are not used properly or efficiently. One way to reduce this waste is by detecting, learning, and predicting when people are present in buildings. To do this, buildings need to become “smart” and “cognitive” and use modern technologies to sense when and how people are occupying the buildings. By leveraging this information, buildings can make smart decisions based on recently developed methods. In this paper, we provide a comprehensive overview of recent advancements in Internet of Things (IoT) technologies that have been designed and used for the monitoring of indoor environmental conditions within buildings. Using these technologies is crucial to gathering data about the indoor environment and determining the number and presence of occupants. Furthermore, this paper critically examines both the strengths and limitations of each technology in predicting occupant behavior. In addition, it explores different methods for processing these data and making future occupancy predictions. Moreover, we highlight some challenges, such as determining the optimal number and location of sensors and radars, and provide a detailed explanation and insights into these challenges. Furthermore, the paper explores possible future directions, including the security of occupants’ data and the promotion of energy-efficient practices such as localizing occupants and monitoring their activities within a building. With respect to other survey works on similar topics, our work aims to both cover recent sensory approaches and review methods used in the literature for estimating occupancy.