While all magnets share the concept of generally having two poles, magnets can differ. Temporary magnets and permanent magnets are the two types of magnets. Permanent magnets are typically made up of iron, nickel, and cobalt. On the other hand, electromagents are examples of temporary magnets. These are formed by electric currents.
Temporary magnets have poles as well.
One end of the solenoid becomes the north pole of the electromagnet and the otehr end the south pole. Its magnetism capabilities are dependent upon the current. If the current switches directions, then so does the poles. Once the current is stopped, the electromagnet loses its magnetism. The most powerful electromagnets are called hybrid magnets.