From the Player's Basic Rules, page 71 (or PHB p. 191):
In contrast, you can move through a hostile creature's space only if the creature is two sizes larger or two sizes smaller than you.
An ogre is a large creature and elves are medium. So an ogre can't move through an elf's space. In your previous example, if we have a 10-foot wide passageway with two elves standing side by side, the ogre can't get through without killing one of the elves or forcing them to move.
The rules on squeezing into a smaller space are for an ogre trying to move along a 5 foot corridor. The rules on creature size that you've quoted back this up—the ogre isn't actually 10 feet wide, that's just the space he controls. So he can move through a 5 foot wide gap, but it's cramped and he can't move freely.
Now, you might be thinking that it's a bit unfair on the ogre if the 2 elves can form an impenetrable barrier against it. As you've said, he'd rather shove them aside than squeeze between them. And he can do just that! From the Player's Basic Rules, page 74:
Using the Attack action, you can make a special melee attack to shove a creature, either to knock it prone or push it away from you. If you're able to make multiple attacks with the Attack action, this attack replaces one of them.
The target of your shove must be no more than one size larger than you, and it must be within your reach. You must make a Strength(Athletics) check contested by the target's Strength(Athletics) or Dexterity(Acrobatics) check (the target chooses the ability to use). If you win the contest, you either knock the target prone or push it 5 feet away from you.
So you're right, shoving is the ogre's answer here.
Now, with your new example, (2 elves in a 15 foot corridor with a 5 foot gape between them), things are different. The ogre does indeed have to squeeze between them. Fortunately for him, it's not going to matter all that much.
Why? Because he's almost guaranteed to be moving on his own turn. Unless there are more enemies than just the elves, he's not going to provoke any opportunity attacks while squeezing, and he can attack before or after he squeezes. So the only squeezing penalty that is actually going to apply to him in this situation is the double cost for movement.
Note that if he stopped between the elves, all these penalties would apply to him. That makes sense though—standing between two enemies with not enough space to move around in would make it difficult to dodge attacks or attack effectively.
Run Death House
Death House serves much better as an introduction to CoS over Phandelver. Phandelver is a great adventure, and I started as a player with it, but it would serve you better later if you want to run a classic D&D adventure, with less gothic horror elements. I'm DMing Curse of Strahd now and started my group with Death House.
Death House will teach you certain DM skills, and it will reinforce the skills necessary for the PCs to survive Curse of Strahd. Here's my justification:
Introduce with Roleplay and dread
Curse of Strahd is a roleplay-heavy campaign — there are lots of situations you don't want to bash your way through. Additionally, Death House will, if played correctly, teach you as DM to foreshadow threats and create a sense of dread that will help with the rest of the campaign on both sides of the table.
For example, the desolate streets of Barovia, with only a single house on the outskirts lit up, with smoke pouring out of the chimneys will draw the players in, but also give them the eerie feeling something is wrong. You'll have to play the children correctly to bait the players in, but you can always use the mists to railroad them as necessary. Once they're in the house, you'll be able to hook them in.
This introduction is much more in-line with the tone and nature of the rest of the campaign.
Take time to describe the environment
This is critical with Death House, but less emphasized with Phandelver. With Death House, you'll need to take time in each room, describing the blazing hearths, the strange wolf-helm armor, everything. It's all important, because it also teaches the players to pay attention to the environment. When
the blazing hearths pour out poison smoke in the 2nd phase,
they'll get a good idea of how Barovia works. You'll have plenty of chances to have them roll Investigation, Perception, and Insight during the buildup, and therefore teach them some fundamental rules, and fundamental survival skills for later.
Toss a bit of combat in after
The first fight will likely occur later,
on the 3rd floor.
This will be after the players have had the run of the house for a bit, and will give you plenty of time to switch from warm, but empty house, to
the dusty, old, decrepit 3rd floor.
Using that buildup, when something bad happens like
the armored statue punching a player in the face,
the players will be alert to such changes. It's also an easy fight to run, but will introduce damage resistance and basic combat rules.
Phandelver starts you off with a goblin ambush, which is fine, but Curse of Strahd places the emphasis on the fact that the players can walk into dangerous areas — Phandelver's goblin ambush is more of a device used to spur the plot along (perhaps much like the mists). Death House will give you a chance to explore first. Having the combat after emphasizes where the priorities should be in this campaign, I think.
Ramp up the danger
Death House is notorious for how lethal it can get — your players can absolutely TPK against
the Shadows, or the Shambling Mound in the basement.
However, much of the campaign is like this — you'll get to make the decision of how hard to beat them over the head with their impending doom, or how to fail forward. You'll learn from your players what they expect out of a campaign with this kind of tone, and it'll get everyone on the same basis. Starting with Phandelver, I think you stand the danger of letting them be the big damn heroes and then taking that away from them.
Best Answer
It triggers under the weight of 400 lbs worth of creatures, however many creatures that may be.
There is no "close formation" rule you are missing. The text of the trap is describing characters in close proximity to each other, which is just what it means.
Since the trap is a 10 ft square, using the combat movement rules explicitly as written, 4 Medium creatures could fit in the trap's space. If each creature is about 100 lbs, it's easy to see that they could trigger the trap. Fewer creatures or creatures carrying a lot of stuff could trigger the trap if they still summed to 400 lbs.
However, it is unlikely the text of the trap is trying to be that pedantic. When you as the DM consider that the trap has been laden with the weight of 400 lbs worth of creatures passing over it, you can consider it to be triggered.
For example, you could consider 5 characters marching in a tight cluster to trigger the trap even though the combat movement rules don't technically allow 5 Medium creatures to fit into that space, because in the real world or in a reasonable imagining of the in-game situation it's possible for 5 creatures to fit in a 10 ft square space. Picture any elevator you've ever been in.
Moreover, the combat movement rules consider each character's movement in isolation over a sequence of turns. It's entirely possible that, mechanically, at no point in time do 4 creatures end their turns of movement precisely on 4 distinct 5 ft squares of the trap's space, but that's due to limitations inherent to the combat abstraction. When 4 people are marching in tandem, they're not going one at a time, even if the combat movement rules suggest they are. They're moving simultaneously. So by a reasonable understanding of how people move it's possible for them to all trigger the trap by moving atop it.
Basically, there's no formula or rule to determine when the trap triggers other than when you as the DM estimate that 400 lbs of weight has been applied to it. Depending on how you run your dungeon exploration (square by square, theater of the mind, precise movement, abstract movement, tape measures, fudging it, or so on) you might be more or less picky about it, but it's still up to your judgement, since the actualization of this world is the DM's.