A search for the standard model Higgs boson produced in association with a top quark pair is presented, using 19.6~fb of 8 TeV collision data collected by the CMS experiment at the LHC. Final states with a Higgs boson that decays to either ,, or are required to have a top quark pair that decays to either lepton plus jets () or dileptons (), where represents an electron or a muon. The following signatures are selected: two isolated same-sign leptons (electrons or muons) plus b-tagged jets, three isolated leptons plus b-tagged jets, or four isolated leptons plus b-tagged jets. The expected 95\% confidence level upper limit on the Higgs boson production cross section for a Higgs boson mass of 125.7 GeV/c is times the standard model expectation, to be compared to an observed limit of . The signal strength , relative to the expectation for the standard model Higgs boson, is measured to be .