Great question, the short answer is almost everything that is social/intelligent with arms and legs is humanoid that belongs on Faerun - Otherwise it is an Animal or Monstrosity.
This is fairly misleading advice, especially since the OP asked specifically about Ogres (Giant, not humanoid) and Hags (Fey or Fiend, depending on the type of hag, not humanoid), both of which are social and intelligent (after a fashion in the former case) and both of which are prime material denizens. The broad swathe of intelligent/sentient undead are, despite what a vampire might tell you, Undead - not humanoid, and the native-material-dwelling myconids, despite their social and intelligent inclinations, are Plant, not humanoid. Not to mention that Gith are not prime material denizens but are Humanoid by category.
It's not that it's a particularly bad rule of thumb in general, but it will lead you wrong often - and especially in Act I of BG3, a large portion of intelligent creatures that we encounter are not, in fact, humanoids.
It is a failing of the game in one way that, in the examination window, it doesn't actually tell you the creature's type properly - it conflates race and type into a single box, which then functionally kills any actual clarity, since the line can display any number of things that are not formal types, in amongst actual types...