3.5 cord wiring

Can a standard 3.5 cord be wired in/out/thru? I’m trying to connect to Yamaha keyboards so that sound stays in the headphones and the kids can hear one another.

Thx

Are you trying to mix two keyboards to one headset or something different?