Network lifetime is a critical factor in determining the effectiveness of Wireless Sensor Networks (WSNs). The optimization of the battery lives of the sensor nodes following the targets in terms of continuity of WSNs coverage in military and civil applications plays an important role in extending the network's lifetime. Since the sensor nodes that constitute WSNs have limited battery life, the energy of the sensors gradually decreases as a result of communicating among themselves and perceiving field of interest. Ultimately, the node consumes its energy completely and causes WSN to fail to function. For this reason, the optimization of the lifetime of WSNs has been one of the most frequently studied topics in the literature. In this article, it was aimed to optimize the lifetime of the network by performing dynamic distributions of the nodes provided that the coverage requirements (1 <= k <= 4) of the maximum four sensor nodes are met to find solution to the target coverage problem in WSNs. It was aimed to determine the accessible lifetime of the network by calculating the remaining battery life of the nodes and the upper limit of the network lifetime when the coverage requirements of the targets are met. In addition, Electromagnetism-Like (EM) algorithm, which is meta-heuristic in performing the dynamic distributions of sensor nodes, was taken as a basis, and a new energy-efficient algorithm was developed. The accessible network lifetimes calculated with this algorithm were compared with the Artificial Bee Colony (ABC) and Particle Swarm Optimization (PSO) algorithms in the literature. According to the obtained simulation results, it was found that the algorithm developed in reaching the upper limit of the network lifetime gave more optimum results.