Section 15. The defendant shall not be liable for rents and profits for any time more than six years prior to the commencement of the action or for waste or damage committed before said six years, unless rents and profits are allowed to diminish the defendant's recovery upon his counterclaim for improvements under section twenty-seven.