It is possible have have your center of gravity (G) below your center of buoyancy (B). For instance, sailing ships racing in the america's cup displace about 25 tons. 20 tons is in the keel! Pic:
But normally you have G above B. A ship that also always has G below B is a submarine, otherwise it would immediately 'capsize'.
Back to ships, and it helps to envisave a floating block (quite easy). G is above B!. Now, the 'dent' the ship makes in the water is now cube shaped and its center of gravity is called B. I'm stealing pics around the net :)
If you give this block an angle, the underwatershape shanges. Try not to think that you are rotating the ship, try to see it as rotating the waterline. What happens is that a part of the ship is now dry, another part is now wetted. This means that the point B will shift towards the part of the ship that has now entered the water as the center of gravity of the submerged body changes accordingly with its shape.
The above pic illustrates this. Notice that a line drawn straight up intersects the mid line? This point is called the Metacenter. (Note that this point is also not fixed, it depends on your initial angle etc)
How much does B shift? This depends on two things. 1) How wide is the ship and 2) what is it's total displacement. If the displacement is very small and the ship is very wide, the part of the ship entering the water is relatively very large and B will shift a lot to the wetted side. Of course, it won't move if the ratio's are reversed. Concluding: the ratio of the waterline(!) and the displacement determine stability. (actually it's the ratio between waterline moment of intertia and displacement that determine the distanve from B to M)
Why is this important? Think if the block under an angle. If you draw the block under an angle, G is above B, with the forces acting on it, you'll see that G tries to capsise the ship. Well, with stabilty and the change of the underwater hull shape, B will shift. If it shifts more outboard than G, the resulting forces produce a moment that will turn the ship back into its initial position. Otherwise it capsizes. The pic below illustrates this perfectly
Each ship has its own 'point of no return'; any further and G will be outboard of B. Some ships (life boats!) are so stable they'll never capsize. Note that if your ship is fully watertight, that even if it does capsize and floats upside down, it is stable again. Normally a hatch or porthole or something else nasty hits the waterline and ships takes in water.
Note that when the deck hits the water, the waterline width drastically dimishises with disastrous results for stabilty. And this is all static. If you have some rolling speed, ths ships inertia may take it beyond its point of no return. Dynamic stabilty is thus quite important!
A second caverat are waves: they can change you waterline. If you have a wave crest amidships, the waterline can be very slender near the bow and stern (wave troughs near the bow). This low of waterplane area has been the cause of spontaenous capsizes of otherwise quite stable ships when a wave approximately as long as the ship itself with more or the less the same speed as the ship met.