CONCORD, N.H. and HELENA, Mont.—Legislation prohibiting municipalities in New Hampshire from requiring fire sprinkler systems in homes has passed the Legislature and is headed to the governor’s desk.