You can only play online multiplayer games if you have Xbox Live Gold, which is a separate subscription. XBox game pass gives you access to a lot of games, including some online multiplayer ones. However, if you don´t have XBox Live Gold, you will not be able to play online with other people.
Some games are designed for multiplayer without having to play online (i.e. Mortal Kombat, Worms or Injustice). These you can play with other people, but they will have to be with you and you need two or more controllers.
There are plenty of Xbox Live Gold deals out there. I do recommend getting it not just because the online player option, but also because you get 4 free games each month.
Hope this helps.