Although "center of gravity below center of buoyancy" may be the right answer for this question it's not the right answer in practical naval architecture!
In practice, naval architects will purposely design a surface vessel such that the center of buoyancy is actually below the center of gravity. This indeed will cause the ship to roll in one direction or another, but the roll angle is limited by another opposing force. As the ship rolls, the "water plane" that projects through the vessel increases and this shifts the center of buoyancy such that it is raised above the center of gravity - which never changes position. So the center of gravity, and what's known as the 'righting arm' from a changing center of buoyancy lead to a very slow harmonic motion in the ship's roll motions. Drag forces between the ship's surface and water tend to dampen this motion.
Why do the designers do this? By having the center of gravity above the center of buoyancy the vessel becomes easier to maneuver in terms of changing the ship's heading. If the ship cannot roll easy it tends to resist changes in heading. A ship with its center of gravity below the center of buoyancy is called 'bottom heavy', and some ships are designed in this way such as sail boats. Sail boats typically have a long keel that lowers the center of gravity well below the center of buoyancy to balance out forces from the wind onto the sail's and masts.
Stability is usually not measured by the center of buoyancy and center of gravity directly, but rather indirectly by a measure derived from the two and also taking into account the effects of water plane: the Metacentric Height . Metacentric height can be numerically derived from a ship's data, but more accurately determined empirically using the inclining experiment .
But getting back to your specific, original question. To understand how the center of gravity behaves relative to center of buoyancy imagine a pendulum constructed from a rotating joint, and a stick connecting the rotating joint to a weight at the other end of the stick - the pendulum 'bob'. The weight is the ship's center of gravity, and the pivot point is the ship's center of buoyancy.
If you start with the bob directly over the center of rotation (center of gravity over center of buoyancy) and just give it a small nudge, the pendulum will move away from the nudge and go through a large swing so that the bob eventually comes to rest below the center of rotation.
If however you start with the bob directly below the center of rotation (center of gravity below center of buoyancy) and then give it a small nudge you will feel the pendulum push back towards the nudge, attempting to maintain it's lower position.
The first case - the 'inverted' pendulum is 'unstable'. The latter case, the pendulum as we normally see it, is 'stable'.
That's ship stability in a nutshell.