You may become a Swiss tax resident if you spend at least 90 days in Switzerland without being gainfully employed. Temporary interruptions do not interrupt the qualifying stay. This rule tracks days in Switzerland only; make sure the no-gainful-employment condition applies to you.
https://www.estv.admin.ch/en/the-swiss-tax-system-publication