You can only use your state’s exemptions if you’ve lived in the state for at least 2 years (730 days) when your case is filed. This is called the 730-day rule.
If you haven’t been in the same state for at least 2 years, you have to use the exemption laws of the state where you lived in the 6 months (180 days) 2 - 2.5 years ago. This is called the 180-day rule.
Some states don’t allow non-residents to use their exemptions. In that case, you’re limited to using the federal bankruptcy exemptions.
For more information on how this works, check out this article in Upsolve’s Learning Center.