How is vitamin B12 stored in the body although it is water-soluble?
Vitamin B12 (cobalamin) is a cofactor required by the enzymes methionine synthase (MTR) and methylmalonyl-CoA mutase (MUT). These are the only known enzymes that use B12 in humans, and are abundant in the liver. Since it is a cofactor, B12 is not consumed by any reactions, and hence there is no need to store large amounts of B12 beyond that bound to MTR and MUT. (In contrast to major nutrients like glucose and fats, which are stored in large amounts.)

Early biochemical studies showed that B12 isolated from cells was bound to an unknown large protein complex, called the intracellular cobalamin binding protein (ICB). It was later found that ICB actually consisted two separate proteins, and that these were identical to MTR and MUT.

So B12 is "stored" by simply being attached to the enzymes that require it. But, as @jzx also pointed out, perhaps "storage" is not an accurate description --- cobalamin is an integral part of these enzymes; it is not present in excess, and not kept in some storage compartment from where it can be mobilized (like glycogen, for example).