Results of a search for the standard model Higgs boson produced in association with a top quark pair (tt¯H) in final states with electrons, muons, and hadronically decaying τ leptons are presented. The analyzed data set corresponds to an integrated luminosity of 35.9 fb−1 recorded in proton-proton collisions at s√=13 TeV by the CMS experiment in 2016. The sensitivity of the search is improved by using matrix element and machine learning methods to separate the signal from backgrounds. The measured signal rate amounts to 1.23 − 0.43 + 0.45 times the production rate expected in the standard model, with an observed (expected) significance of 3.2σ (2.8σ), which represents evidence for tt¯H production in those final states. An upper limit on the signal rate of 2.1 times the standard model production rate is set at 95% confidence level.