Even though you can leave a game installed on another person’s console, they will not be able to play it unless they also own the game. Instead, they’ll be prompted to insert the disc or purchase a digital copy.
Regional restrictions may apply in some cases, as not all games are available in every country. For more information, see Xbox One locales FAQ.
Each Xbox One console must have either a digital or physical copy of a game. For example, if you have other Xbox One consoles in your home and other people want to play the same game with you using those additional consoles, each console must have its own copy of the game.
In order to play multiplayer games online, you must have an Xbox Live Gold subscription.