The rule for the Halfling (Lightfoot subrace) ability is as follows on Page 17 of the Basic D&D PDF.
Naturally Stealthy. You can attempt to hide even when you are obscured only by a creature that is at least one size larger than you.
Reading the Hiding rule on Page 60 with find this.
You can’t hide from a creature that can see you, and if you make noise
(such as shouting a warning or knocking over a vase), you give away
your position
While a halfling can run underneath an Ogre and try to hide it won't work against the Ogre as all the thing has to do peer between its legs and it will see the halfling. Since combat rounds are six seconds and there is little in the way of facing rules in the game this effectively means that the halfling will be spotted by the ogre as nothing obscures the ogre view of the halfling.
Unless you rule that the ogre is so bulky that it can't see between it legs. In which case any character that can fit underneath can opt to execute the hide action as line of sight is blocked i.e. heavily obscured according to the criteria on page 65, the rules of hiding on page 60 and the description of the hide action on page 72.
The strict reading of the rules indicates what the halfling can to is run underneath the ogre and is use it for hide against any other potential enemy in the area.
Page 71
When you take your action on your turn, you can take one of the
actions presented here.
Note that Hiding is a specified action. Barring any bonus action a character will need two rounds to execute the attack. Round 1 is to run up and hide, and round 2 the sneak attack occurs. But since the Halfling Rogue character is above 2nd level, he can use Cunning Action to use Hide as a bonus action.
If you make this ruling then you will likely need to distinguish between large creatures that are bulky and thus can be hidden underneath and those that are not. What make sense for a Ogre or Giant may not make sense for all Large sized creatures.
My personal opinion that given the long combat round and the abstraction of facing that I would not make this ruling. I would allow the halfling to use the ogre to hide against other enemies.