Almost all spirillum, half of all rods, and rarely cocci are motile via flagella. You can wave your hands a little to justify why the coccus morphology and motility are mutually exclusive. A spherical shape would probably cause much more drag on the cell than a rod, so if you are going to be motile, be a streamlined rod. Structure Flagella can be thought of as little semi-rigid whips that are free at one end and attached to a cell at the other. Due to their small diameter, flagella cannot be seen in the light microscope unless a special stain is applied.
Bacteria can have one or more flagella arranged in clumps or spread all over the cell.
The figure below demonstrates some of the more common arrangements. The number of units, the wavelength and diameter of a single helix of the flagella are determined by the protein subunits. Below is a picture of a common flagella in a Gram negative bacteria. The hook and basal body of the flagella attach it to the cell. If a flagellum is cut off it will regenerate until reaches a maximum length.