  We find that the motion of the valley electrons -- electronic states close to
the ${\rm K}$ and ${\rm K'}$ points of the Brillouin zone -- is confined into
two dimension when the layers of MoS$_{2}$ follow the 3R stacking, while in the
2H polytype the bands have dispersion in all the three dimensions. According to
our first-principles band structure calculations, the valley states have no
interlayer hopping in 3R-MoS$_{2}$, which is proved to be the consequence of
the rotational symmetry of the Bloch functions. By measuring the reflectivity
spectra and analyzing an anisotropic hydrogen atomic model, we confirm that the
valley excitons in 3R-MoS$_{2}$ have two-dimensional hydrogen-like spectral
series, and the spreads of the wave function are smaller than the interlayer
distance. In contrast, the valley excitons in 2H-MoS$_{2}$ are well described
by the three-dimensional model and thus not confined in a single layer. Our
results indicate that the dimensionality of the valley degree of freedom can be
controlled simply by the stacking geometry, which can be utilized in future
valleytronics.
