In the section on combat, the PHB p191 says "Whether a creature is a friend or an enemy, you can’t willingly end your move in its space."
Even in combat, are there specific rules that override this general rule? For instance, while grappling or restraining a creature. Or hiding behind a creature. Or if you just run out of movement and there you are.