We report the discovery of two planetary systems, namely G 264-012, an M4.0 dwarf with two terrestrial planets (M_b_sini=2.50^+0.29^-0.30_M{sun} and M_c_sini=3.75^+0.48^-0.47_M_{sun}), and Gl 393, a bright M2.0 dwarf with one terrestrial planet (M_b_sini=1.71+/-0.24M{sun}_). Although both stars were proposed to belong to young stellar kinematic groups, we estimate their ages to be older than about 700Ma. The two planets around G 264-012 were discovered using only radial-velocity (RV) data from the CARMENES exoplanet survey, with estimated orbital periods of 2.30d and 8.05d, respectively. Photometric monitoring and analysis of activity indicators reveal a third signal present in the RV measurements, at about 100d, caused by stellar rotation. The planet Gl 393b was discovered in the RV data from the HARPS, CARMENES, and HIRES instruments. Its identification was only possible after modelling, with a Gaussian process (GP), the variability produced by the magnetic activity of the star. For the earliest observations, this variability produced a forest of peaks in the periodogram of the RVs at around the 34d rotation period determined from Kepler data, which disappeared in the latest epochs. After correcting for them with this GP model, a significant signal showed at a period of 7.03d. No significant signals in any of our spectral activity indicators or contemporaneous photometry were found at any of the planetary periods. Given the orbital and stellar properties, the equilibrium temperatures of the three planets are all higher than that for Earth. Current planet formation theories suggest that these two systems represent a common type of architecture. This is consistent with formation following the core accretion paradigm.