A search for a heavy scalar boson decaying into a pair of lighter standard-model-like 125 GeV Higgs bosons and a search for a heavy pseudoscalar boson decaying into a and an boson are presented. The searches are performed on a dataset corresponding to an integrated luminosity of 19.7 fb of pp collision data at a centre-of-mass energy of 8 TeV, collected by CMS in 2012. A final state consisting of two leptons and two b jets is used to search for the decay. A final state consisting of two leptons from the boson decay, and two additional leptons from the boson decay, is used to search for the decay . The results are interpreted in the context of both the minimal supersymmetric extension of the standard model and two-Higgs-doublet models. No excess is found above the standard model expectation and upper limits are set on the heavy boson production cross sections in the mass ranges 260 < < 350 GeV and 220 < < 350 GeV.