A Router is necessary but not sufficient. Here is the complete checklist:
Hardware
Xbox Console: 360, One, Series X|S.
Internet Connection: Broadband (Cable/Fiber/DSL). Min 3 Mbps Down / 0.5 Mbps Up (Microsoft Rec). Recommended: 25+ Mbps Down / 5+ Mbps Up (Gaming + Updates + Streaming).
Xbox Profile (Gamertag): Created on Console / App / Web.
Xbox Game Pass Core (formerly Xbox Live Gold):Required for: Online Multiplayer (Free-to-Play titles exempt on Series X|S/One), Party Chat, Games with Gold (Legacy), Discounts. Not Required for: F2P Online (Fortnite, Apex, Warzone), Apps (Netflix, YouTube), Single Player, System Updates.
Xbox Game Pass Ultimate: Includes Core + Console/PC/Cloud Library + EA Play.