Determine state residency for foreigner

I have a question regarding tax returns. I am an international student who attends college in New York. In 2023, I spent some time in California due to an internship, and I stayed in New York for rest. In this case, in which state am I considered a resident for tax purposes? When I checked websites, California was vague, stating that you are not considered a resident if you are staying temporarily, while New York stated that you are considered a resident if you stayed for more than 184 days. Since I have no "permanent" stay in the U.S, I'm not sure which state I'm a resident of.