Are you shutting down all non-essential programs before starting the game, especially anti-virus and anything network related (utility or monitoring programs, etc)? Have you checked your firewall settings?
Have you tried hosting/joining an Arena match?
Try going into Arena mode, create an arena, open the Connectivity menu and check the settings, then exit to the main menu and try joining in the lobby. Alternately, create a multiplayer game lobby, exit and try joining.
If you are using any mods, try testing in a new profile without any mods enabled.
Try verifying local files: in the Steam library, right click on the game and select Properties, switch to the Local Files tab and then click on the 'Verify Integrity of Game Files...' button. With the GOG version, in the (optional) Galaxy client, select Divinity: Original Sin 2 in the left column, then click on the More button, and in the Manage menu select 'Verify / Repair'. In Galaxy 2.0, select the game, then the settings icon at the top right (beside the Play button) and under Manage Installation select 'Verify / Repair'.
For joining in the lobby, does it make a difference if the host increases the online visibility from friends-only to public? There is also Direct Connection, with a Server ID (which the host can get in the Connectivity Menu after starting a new game or loading a save) or IP address. In the latter case, it can help if the host sets up port forwarding in their router to connect to the PC (ports 23253-23262 and 23243-23252), and then the clients should be able to connect to the external IP address. LAN may be an option, but since you are not on the same local network, it would require VPN software, such as Hamachi. If you use Discord, those invites may also be an option.