If it is confirmed by the above conditions that the distance is only 1 year, and it meets the family's only housing standard, you can sign the transfer agreement and notarize it first, and then pay the money after the transfer formalities are completed.
Generally speaking, the local taxation bureau calculates "five years" from the date when it actually applies to the local taxation bureau for the transfer of second-hand houses and pays taxes and invoices (this is the case here). In that case, it's no problem to go to the local taxation bureau to pay taxes and invoice after five years next year.
However, it is not excluded that some local local tax bureaus use the date of notarial deed as the date of house sale to calculate the "five years" time. Therefore, if it is safer, you need to consult the second-hand housing transaction window of the local tax or call the tax service hotline 12366.