Net force acting on a body is zero, if two forces acting on it are:
Equal in magnitude and opposite in direction
When two forces acting on a body are in the opposite direction, the resultant force is the difference between the two forces in the direction of the larger force. However, the net force is the sum of the two forces if they are acting in the same direction. Thus, the net force will be zero if the two forces are equal in magnitude and opposite in direction.