Which State do I report my tax if I am NC residence but have to go to California for a couple of month?

I currently worked as a NC remote working in my companies payroll.  My company is headquartered in California but also has satellite office in NC. Next year, I may be required to go to office in California for a extensive period of time ( a couple of months) for a project. In that case, in what situation can I remain my NC residency? Do I need to file CA tax return? I am thinking of living in hotel or airbnb, or rent an apartment. Thank you!