Despite the advances mobile devices have endured, they still remain resource-restricted computing devices, so there is a need for a technology that supports these devices. An emerging technology that supports such resource-constrained devices is called fog computing. End devices can offload the task to close-by fog nodes to improve the quality of service and experience. Since computation offloading is a multiobjective problem, we need to consider many factors before taking offloading decisions, such as task length, remaining battery power, latency, communication cost, etc. This study uses the multiobjective grey wolf optimization (MOGWO) technique for optimizing offloading decisions. This is the first time MOGWO has been applied for computation offloading in fog computing. A gravity reference point method is also integrated with MOGWO to propose an enhanced multiobjective grey wolf optimization (E-MOGWO) algorithm. It finds the optimal offloading target by taking into account two parameters, i.e., energy consumption and computational time in a heterogeneous, scalable, multifog, multi-user environment. The proposed E-MOGWO is compared with MOG-WO, non-dominated sorting genetic algorithm (NSGA-II) and accelerated particle swarm optimization (APSO). The results showed that the proposed algorithm achieved better results than existing approaches regarding energy consumption, computational time and the number of tasks successfully executed.