inflation reduction act residency duration requirements

in order to get a rebate or tax credit under the inflation reduction act, do i have to live in the house for the entire year? do i have to continue living there until i file taxes the following year?  e.g. if i move into a house on december 1st, install a heat pump on december 15th then move out on december 30th, would i qualify?  what if i moved in during december of 2022, installed the heat pump in june of 2023, then moved out in february of 2024?