i know the basics of a motor but i dont know about a ac motor
The ac motor requires 2 or more ac lines that are at some fixed phase difference between them. When wired to electromagnets arranged in a circle (called the stator), this creates a rotating magnetic field. The rotor, the rotating part of the motor, is basically a magnet that will follow the rotating field. You can even get an ac motor to work with only one ac line by using a capacitor to create another phase.