Two Players on One Xbox Console for Xbox Live: Separate Accounts or Local Multiplayer Required
You cannot run two simultaneous Xbox Live sessions on one console with a single account. Each player needs their own profile to play online together.
Options for Two Players
Two Separate Accounts (Best): Each player signs in with their own Xbox Live Gold / Game Pass Core account. Play online together in split-screen or co-op—each on their own gamertag.
Local Multiplayer (Split-Screen / Shared Screen): Many games support 2-player local (Halo, Call of Duty, Gears of War, Rocket League, fighting games). The second player often doesn't need Gold if the host has it (varies by title).
Game Pass Ultimate Sharing: Set the console as the Home Xbox for the primary account (Gold/Ultimate). A secondary account on the same console gains Gold benefits—online multiplayer, Game Pass library—without its own subscription.