Second-harmonic generation (SHG) has found extensive applications from hand-held laser pointers to spectroscopic and microscopic techniques. Recently, some cleavable van der Waals (vdW) crystals have shown SHG arising from a single atomic layer, where the SH light elucidated important information such as the grain boundaries and electronic structure in these ultra-thin materials. However, despite the inversion asymmetry of the single layer, the typical crystal stacking restores inversion symmetry for even numbers of layers leading to an oscillatory SH response, drastically reducing the applicability of vdW crystals such as molybdenum disulfide (MoS2). Here, we probe the SHG generated from the noncentrosymmetric 3R crystal phase of MoS2. We experimentally observed quadratic dependence of second-harmonic intensity on layer number as a result of atomically phase-matched nonlinear dipoles in layers of the 3R crystal that constructively interfere. By studying the layer evolution of the A and B excitonic transitions in 3R-MoS2 using SHG spectroscopy, we also found distinct electronic structure differences arising from the crystal structure and the dramatic effect of symmetry and layer stacking on the nonlinear properties of these atomic crystals. The constructive nature of the SHG in this 2D crystal provides a platform to reliably develop atomically flat and controllably thin nonlinear media.