Electrons in two-dimensional layered crystals gain a discrete positional degree of freedom over layers. We propose the two-dimensional transition metal dichalcogenide homostructure with polar symmetry as a prototypical platform where the degrees of freedom for the layers and valleys can be independently controlled through an optical method. In 3R MoS2, a model system, the presence of the spontaneous polarization and built-in electric field along the stacking axis is theoretically proven by the density functional theory. The K valley states under the electric field exhibit Wannier-Stark type localization with atomic-scale confinement driven by double group symmetry. The simple interlayer-dynamics-selection rule of the valley carriers in 3R homostructure enables a binary operation, upward or downward motion, using visible and infrared light sources. Together with the valley-index, a 2 [Formula: see text] 2 states/cell device using a dual-frequency polarized light source is suggested.