You can add multiplayer player support in your games in many ways. Firstly there is a WebRTC(Real-Time-Communication), where you can communicate peer to peer, but WebRTC is a work in progress project and only supported by new builds of Chrome and FireFox.
Then there is a second way by having a central server, through which the devices exchange information. In HTML5 you can use websockets at client side to send and receive messages. On server side, you can use any language like PHP, Node.Js, Ruby, etc and handle connection to those websockets. I won't recommend you to use AJAX as it will not give you a good real time experience. To host your game you can use any PaaS(Platform As A Service) service or even maintain your own server and host it there. But hosting your server involves a great cost and also need proper maintains.
There is also another way to achieve multiplayer game development. It's by using BaaS(Backend As A Service), where you don't need to buy a server. You don't even need to write server side code. These BaaS providers have SDKs for different platforms, where you can use multiplayer service by using their APIs. You only need to write multiplayer logic at client side only.
There are different options available, you should explore all of them, and according to your requirement, skill and resources you can should choose one.