Unfortunately, like all other Lego games, there is not an online multiplayer option, meaning you'll need to be in the same room with whoever you wish to play with. This has long been a downside to the franchise's installments and puts it significantly behind its competitors.
There are various third-party apps and programs you can install that will allow you to host an online session of the game, though since they're not directly supported by the game's developer, their reliability can be spotty.
This also means that there isn't a cross-play option for players. You can only enter a multiplayer game mode with one other person who is using the same console as you. Unfortunately, it's also unclear if there will be any online connectivity added to the game in the future, though as all of the previous games in the franchise do not feature such options, it's highly unlikely we'll see it for Lego Star Wars: The Skywalker Saga.