steppermotor only few steps

It sounds like the hardware is working OK

Now to add more control.

Instead of detecting when the button is pressed change the program to detect when the button becomes pressed. See the StateChangeDetection example in the IDE. Then, when the button becomes pressed run the motor for 200 steps so that it does one revolution and stops. When the button becomes released run the motor for 200 steps in the other direction. A for loop will be handy for making the motor move 200 steps.