The growth of the Internet of Things (IoT) and its application in various fields has resulted in the generation of significant amounts of data for processing. The Hybrid Cloud–Fog architecture makes it possible to send latency-sensitive tasks to Fog resources because of its proximity to IoT devices. More complex tasks should be sent to the Cloud data center because of its computational power and storage capacity. The scheduling of requests to optimize latency and energy consumption is a major challenge and an NP-hard problem in Cloud–Fog computing. In this study, first, we define a new multi-objective function to make a good trade-off between latency and energy. Then, to optimize this multi-objective function, we propose a Multi Objectives Cuckoo Search algorithm (MOCS) algorithm, improved by Boltzmann function, to reduce the latency and energy consumption. The simulation result proves that the improved MOCS algorithm is more effective in optimizing latency and energy consumption compared to the state-of-the-art algorithms. Using Evaluation Criteria indicates that the improved MOCS, based on the Boltzmann function, enhances its exploration and exploitation capabilities.