Depending on the direction you wound the coils, it will either stay still ( coils attracting magnets) or rotate 90 deg to reach the same state.
Once it has rotated that 90 deg you need to reverse the connections to the coil and then it will go another 90 deg aand then you need to rteverse again.
In days of old before electronics the only way was with a commutator and brushes and that method still works today. For those brought up in the space age you can use electronic switches ( mosfets , transistors or similar ) and you need something to tell it when to switch ( hall sensors or opto sensors or obtain feedback from the emf induced in the coils.
Don't try to invent the wheel , just look up electric motor. Alternators don,t run off batteries as motors.
Flux