In general two Higgs doublet models (2HDMs) without scalar flavour changing neutral couplings (SFCNC) in the lepton sector, the electron, muon and tau interactions can be decoupled in a robust framework, stable under renormalization group evolution. In this framework, the breaking of lepton flavour universality (LFU) goes beyond the mass proportionality, opening the possibility to accommodate a different behaviour among charged leptons. We analyze the electron and muon $(g-2)$ anomalies in the context of these general flavour conserving models in the leptonic sector (g$ell$FC). We consider two different models, I-g$ell$FC and II-g$ell$FC, in which the quark Yukawa couplings coincide, respectively, with the ones in type I and in type II 2HDMs. We find two types of solutions that fully reproduce both $(g-2)$ anomalies, and which are compatible with experimental constraints from LEP and LHC, from LFU, from flavour and electroweak physics, and with theoretical constraints in the scalar sector. In the first type of solution, all the new scalars have masses in the 1--2.5 TeV range, the vacuum expectation values (vevs) of both doublets are quite similar in magnitude, and both anomalies are dominated by two loop Barr-Zee contributions. This solution appears in both models. In a second type of solution, one loop contributions are dominant in the muon anomaly, all new scalars have masses below 1 TeV, and the ratio of vevs is in the range 10--100. The second neutral scalar $H$ is the lighter among the new scalars, with a mass in the 210--390 GeV range while the pseudoscalar $A$ is the heavier, with a mass in the range 400--900 GeV. The new charged scalar $H^pm$ is almost degenerate either with the scalar or with the pseudoscalar. This second type of solution only appears in the I-g$ell$FC model. Both solutions require the soft breaking of the $mathbb{Z}_{2}$ symmetry of the Higgs potential.