For ordinary residency it’s 183 days.
For « the residence program », the 15k€ one, there is no stay requirement, just don’t spend more than 183 days in another country.
If you want a tax residency certificate, looks like you could do it after 3 years, and it seems you need to prove that you...