Could you slam 2 shields together for trapping enemies to gain advantage on attacks by others later? It seems like it should be a logical maneuver to make but I can’t find any rules either way about it.
You could use the Help action for this
"I trap him between my shields" seems like an excellent way to describe how your help is giving someone else Advantage on an attack, and that's exactly what the Help action offers. And everyone can do it.
You would not gain advantage inherently.
The only rules that outline this type of situation is the rules on Grappled. Of course you usually can only grapple with a free hand but I would personally wave this requirement with this tactic since you cant benefot from more than one shield anyway. A grappled creature has its speed reduced to 0 but does not grant advantage.
A grappled creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.
With the grappler feat...
A character could pin a grappled target imposing the restrained condition which would allow for advantage:
You can use your action to try to pin a creature grappled by you. To do so, make another grapple check. If you succeed, you and the creature are both Restrained until the grapple ends.
Attack rolls against the creature have advantage, and the creature’s attack rolls have disadvantage.