Aims. We aim to understand the physical mechanisms that drive star formation in a sample of mass-complete (>109.5 M⊙) star-forming galaxies (SFGs) at 1.2 ≤ ɀ < 1.6. Methods. We selected SFGs from the COSMOS2020 catalog and applied a uυ-domain stacking analysis to their archival Atacama Large Millimeter/submillimeter Array (ALMA) data. Our stacking analysis provides precise measurements of the mean molecular gas mass and size of SFGs down to a stellar mass of M★ ~ 109.5 M⊙, even though at these stellar mass galaxies on the main sequence (MS) are no longer detected individually in the archival ALMA data. We also applied an image-domain stacking analysis on their HST i-band and UltraVISTA J - and Ks-band images. This allowed us to trace the distribution of their stellar component. Correcting these rest-frame optical sizes using the Rhalf–stellar–light-to-Rhalf–stellar–mass conversion at rest 5000 Å, we obtain the stellar mass size of MS galaxies and compare them to the sizes of their star-forming component obtained from our ALMA stacking analysis. Results. Across the MS (−0.2 < ∆MS = log(SFR/SFRMS) < 0.2), the mean molecular gas fraction of SFGs increases by a factor of ~1.4, while their mean molecular gas depletion time decreases by a factor of ~1.8. The scatter of the MS could thus be caused by variations in both the star formation efficiency and molecular gas fraction of galaxies. The mean molecular gas fraction of MS galaxies decreases by a factor of ~7 from M★~ 109.7 M⊙ to ~1011.3 M⊙, while their mean molecular gas depletion time remains roughly the same at all stellar masses. This finding could be a hint that the bending of the MS at ɀ ~1.4 is primarily driven by variations in cold gas accretion. The majority of the galaxies lying on the MS have RFIR ≈ Rstellar. Their central regions are subject to large dust attenuation. Starbursts (SBs, ∆MS > 0.7) have a mean molecular gas fraction ~2.1 times larger and mean molecular gas depletion time ~3.3 times shorter than MS galaxies. Additionally, they have more compact star-forming regions (~2.5 kpc for MS galaxies vs. ~1.4 kpc for SBs) and systematically disturbed rest-frame optical morphologies, which is consistent with their association with major-mergers. SBs and MS galaxies follow the same relation between their molecular gas mass and star formation rate surface densities with a slope of ~ 1.1–1.2, that is, the so-called Kennicutt-Schmidt relation.