Sign in as yourself (the organizer) at account.xbox.com/settings.
Open Privacy & online safety, pick your son’s profile, and go to the Online safety tab.
Set Join multiplayer games and Cross-network play to Allow.
Have your son sign out and back in to Minecraft. On a PC, sign out of the Microsoft Store, the Xbox app and the Minecraft Launcher, then sign back in to each.