A search for the decay of the Higgs boson, with boson decays into pairs of electrons or muons is presented. The analysis uses protonproton collision data at = 13 TeV corresponding to an integrated luminosity of 139 fb recorded by the ATLAS detector at the Large Hadron Collider. The observed data are consistent with the expected background with a -value of 1.3%. An upper limit at 95% confidence level on the production cross-section times the branching ratio for is set at 3.6 times the Standard Model prediction while 2.6 times is expected in the presence of the Standard Model Higgs boson. The best-fit value for the signal yield normalised to the Standard Model prediction is where the statistical component of the uncertainty is dominant.