There are two ways to look at the dimensionality of a game: either the technical dimensionality or the experienced dimensionality.
Technical dimensionality refers to how the game is implemented at the level of its code and tools. A game that is technically 3D expresses its rendering, physics, collision, and simulation of the world in terms of code that operates on three dimensional primitives and uses all three dimensions of those primitives, at least sometimes.
This is different than a game that is experienced in 3D. Experienced dimensionality refers to the style of agency a player has within the game world. If the player has relatively free roam of a 3D world, that game experience is 3D. If the player is confined, however, to a 2D plane within an otherwise 3D world, that would be a 2D game experience.
When we say a game is "3D" we usually mean it is 3D in one of the two senses above. Often the surrounding context of the conversation will provide the clues needed for you to infer which type of 3D is being specified. Sometimes, however, when the context isn't there we clarify and say a game is "3D but with 2D gameplay," or something.