The statute, in plain terms
G.L. c. 140 §155 says that if a dog does any damage to the body or property of any person, its owner or keeper (or the parent or guardian, if the owner or keeper is a minor) is liable, unless the damage was done to a person who, at that time, was committing a trespass or other tort, or was teasing, tormenting or abusing the dog. If the injured person is under seven, it is presumed that none of those things was happening, and the defendant carries the burden of proving otherwise.
The Superior Court's model jury instructions explain that the statute is indifferent to any negligence on the owner's part and that a keeper is someone who harbors the dog and assumes custody, management and control of it. A landlord who simply owns the building is generally neither.