First of all, every object has a center of mass. It also has a support area. The support area is a polygon formed by the contact points with the ground.
The robot will not fall over as long as its center of mass is above that area of support. As soon as the center of mass passes off of the area of support, the robot will fall over.
With all four feet on the ground, the area of support is large, making it easy to balance.
With only two feet on the ground, however, that area of support theoretically gets reduced to a line. Of course, the feet have more than a single point of contact, so it would be a rather thick line, but for ease of explanation, we'll just go with the theory.
Balancing over that single line will be nearly impossible, without an active feedback loop. You could try to translate all of the legs in the direction the robot is tipping to shift the center of mass, but this is inefficient unless you have really good hardware. (Servos are simply too jittery for this, which is why most dogs like MIT mini cheetah and Boston Dynamics Spot use brushless motors.)
Stepper motors are just too expensive, are heavy, and use way more power.
What I would do in this situation is to modify your walking gait so that the robot keeps 3 feet on the ground at a time. This makes the area of support a triangle, which is much easier to balance on than a line.
Just have the robot shift its center of mass as it walks so that it never leaves that triangle.
As someone who has built a robot dog (Or am building, actually), I know that it can be unstable when walking. This is why in my experience, there are three things you can do.
The first thing is to filter the servo motions so they aren't so sudden. Make it smoother.
The second thing is to lower the center of mass, so that the robot isn't as top heavy.
And finally, wait to walk on only two legs until later.
Good luck on your robot!