The easiest way to play online would be installing
Horn of the Abyss expansion as well as the latest version of
HD Mod, that way you'd be able to play online via HotA's online lobby (basically, instant connection to other players without any need to install third-party software like Hamachi or GameRanger to emulated local network, as well as easier search for other players).
It's also worth mentioning that both HotA and HD Mod add lots of essential features and content such as:
- High resolutions
- Hotkeys and general improvement of UI
- Simultaneous turns in multiplayer games
- Balance improvements and bug fixes
- A whole new faction
- New campaigns, new artifacts, new heroes, new map objects, new everything!
"...And much more!"
Both HotA and HD mod work perfectly with gog's version of Heroes 3, by the way.