Consider the following:
The party's resident barbarian, Conan, is targeted by a Ghost's "Possession" ability. He fails the save and is therefore possessed.
Possession (Recharge 6): One humanoid that the ghost can see within 5 ft. of it must succeed on a DC 13 Charisma saving throw or be possessed by the ghost […] The ghost now controls the body […]
The possession lasts until the body drops to 0 hit points, the ghost ends it as a Bonus Action, or the ghost is turned or forced out by an effect like the Dispel Evil and Good spell.
Jack Black, the bard, tries to polymorph his newly possessed friend into a mouse, to make him more manageable. Failed save, the Barbarian body is transformed into a mouse.
So what happens to the Ghost? Is it still possessing the Barbarian even though it is no longer a humanoid?
If it is still possessed, the follow up question relates to what happens when the mouse is killed.
Best Answer
That it is not determined by the rules, but rather at GM's discretion.
There seem to be some controversy on this matter!
Mike Mearls: NO
On the somewhat related question shown up by Sdjz (Posession isn't exactly a spell), tim-grant quotes Mike Mearls:
Since Charm Person requires a Humanoid target, the possession should not end by a successful Polymorph, according to Mike Mearls.
Note that Mearls' Tweets are not considered official but just how he would rule them at his table. Read them as advice from an experienced GM, but remember they are not "official" in the way that Jeremy Crawford's (cited below) are.
Jeremy Crawford: Yes
However the accepted answer on that thread specifies that changing shape into a non-humanoid form, will end form-dependent spells. As specified by BlueMoon93, Jeremy Crawford specifies in a Sage Advice:
As @Adam says in a related answer: