The addition of green hydrogen to the gas mixture feeding domestic boilers may help the ecological transition of the residential sector. However, there are concerns about the combustion process as hydrogen shows power density and reactivity that are much different than those of natural gas. In this work, we perform three-dimensional simulations with detailed kinetics to describe and comprehend the combustion process in a real modern boiler, equipped with a perforated premixed burner (presenting a pattern of small holes and slits), with the purpose also to evaluate the impact of green hydrogen. The flame structure is complex and characterized by the interaction of flames exiting from neighbor holes and slits; these flames may merge and lead to very intense flames, especially at high flow rates. The presence of a flow distributor, upstream of the burner, induces different velocities at the holes and slits, ultimately affecting the morphology, propagation and interactions of the flames. This behavior is observed for all investigated H2 concentrations, i.e., up to 50% by vol. The model is validated against available measurements of carbon monoxide and nitric oxides in flue gases, which both indicate very satisfactory predictions. More specifically, the addition of green H2 has a beneficial effect on both CO and NO emissions. More specifically the CO emissions at the nominal power are observed to diminish from 154 to 18 ppm when shifting from 0 to 50% H2 in the fuel mixture, while NO emissions decrease from 20 to only 5 ppm. This latter reduction is a surprising and encouraging result; the reason is due to the fact that the addition of hydrogen in the fuel mixture leads naturally to more dilute operating conditions in a condensing boiler. We believe that the proposed model represents a valid tool to explore strategies to improve the combustion process with alternative fuels.