If I use shapechange and turn into an intellect devourer and then use Body Thief to possess a humanoid, will I be forced out when the spell ends or remain in control of the humanoid?
There's no specific rule to cover it. Once Shapechange ends, the target ceases to be an Intellect Devourer and loses the Body Thief ability. A character can't take advantage of an ability it no longer has, so it's only reasonable to assume it ends.
How that affects for the occupied body, well... I'll leave that visual to each reader's imagination. The body is dead, though, because Body Thief says:
The body then dies, unless its brain is restored within 1 round.