What exactly counts as a creature's space, given that there are a lot of effects that care about an "unoccupied space"? Are a creature's space, its controlled space, and its occupied space all the same thing? What can we say about the shape of the space, and the height of the space? Is the occupied space of a Medium size creature just five feet high, even when the creature is larger than five feet?
The main rules for Creature Size in the basic rules and PHB state that
A creature's space is the area in feet that it effectively controls in combat
So we know the "creature's space" and "controlled space" are the same thing.
Since that's the only definition we have of a creature's space, we have to assume that's what "occupied space" means, though objects can occupy space even if they aren't creatures -- but a DM will have to judge that for each specific effect. I would personally allow a Medium character to misty step into a space that's smaller than 5 feet wide, but big enough to squeeze into, for example, or teleport under a table in a prone position without worrying about what their combat space is at that moment.
The shape of the space is pretty clear from the Creature Size table: spaces are square. 5x5 feet for a small or medium creature, 10x10 for a large, and so on.
The short version is the height of a creature's space is not clearly defined, and maybe that makes a lot of sense. Horizontal space is much easier to 'control' as you can move and lunge to control a lot more than your body actually occupies, but your ability to strike vertically in combat depends heavily on your actual stature and, in some cases, body-plan. For example, a halfling with a dagger and a great-axe-wielding orc have the same 5x5 combat space, but obviously the orc is going to have an easier time hitting something flying low overhead. Even more to the point, a rhinoceros is a Large creature with a 10x10 space, but can it really hit anything above it, like at all? Its vertical reach should probably be limited to its actual height.
We have asked questions on the boards several times that try to interrogate 'space', such as Is a space with a hazard or Area of Effect 'occupied'? and Can you fly over a Medium enemy creature in a 10ft tall corridor?, if you want to see more.