Somehow we get his IP address then we need to find a random ip adress of another user and somehow connect the two right? But how can I do this..?
Through a game lobby. See my and junatar's previous posts.
Can the game be hosted on a web server?
Yes, indeed. That's what the game lobby does - connects you with a server hosting a game (and connecting you with other players of that game).
<EDIT> To be more precise, the game is split into a component that runs locally and a component that runs on the server, managing the interactions between players.
For example, in a single player FPS game running locally where your enemies are created and controlled by the (Construct 2) code, in a multiplayer game, where your enemies are other players, their actions have to be communicated by the server component of the game.