Please fill out the number of months you’ve spent in the US and claimed a tax treaty on your prior tax returns. If you are unsure whether or not you've claimed the tax treaty before, you can check Schedule OI on your 2022 Federal tax return - Part L.
It is possible that nothing is written there though and if that's the case then you can count and write all the months you worked before 2023 (you must NOT include the 2023 months because that is the year you are filing for).