A search is performed for the production of heavy resonances decaying into top-antitop quark pairs in proton-proton collisions at s=8 TeV. Data used for the analyses were collected with the CMS detector and correspond to an integrated luminosity of 19.7 fb-1. The search is performed using events with three different final states, defined by the number of leptons (electrons and muons) from the tt¯←WbWb decay. The analyses are optimized for reconstruction of top quarks with high Lorentz boosts, where jet substructure techniques are used to enhance the sensitivity. Results are presented for all channels and a combination is performed. No significant excess of events relative to the expected yield from standard model processes is observed. Upper limits on the production cross section of heavy resonances decaying to tt¯ are calculated. A narrow leptophobic topcolor Z′ resonance with a mass below 2.4 TeV is excluded at 95% confidence level. Limits are also derived for a broad Z′ resonance with a 10% width relative to the resonance mass, and a Kaluza-Klein excitation of the gluon in the Randall-Sundrum model. These are the most stringent limits to date on heavy resonances decaying into top-antitop quark pairs.