If you are in X, you are surrounded by X on all or most sides.
The surrounding can work vertically (I'm in a cardboard box) or horizontally (I'm in a box I drew on the ground with chalk).
If you are on X, X is touching your feet or the bottom of yourself, and X is a surface or something flat. If X is something flat and you are on it, you are generally on the top of it.
If you are under X, the "top" of X is generally above your head. At this point, if X is also surrounding you on all or most sides, you are also in x.
Being under X, if X is a surface or something flat, means it is on you, and you can't be on it.
Water is both something that can you can have the top of beneath your head, something that can surround you on most sides and is also something that is a flat surface so it works with all these prepositions.
So you can be:
- in water,
- on water,
- both in and on water,
- both in and under water
- but not really both on and under water.