You do not use the time you were on F-1 Visa to count towards Substantial Presence Test.
What date did you switch to H1B?
According to the IRS:
"Do not count days for which you are an exempt individual. The term "exempt individual" does not refer to someone exempt from U.S. tax, but to anyone in the following categories:
An individual temporarily present in the U.S. as a foreign government-related individual under an “A” or “G” visa, other than individuals holding “A-3” or “G-5” class visas.
A teacher or trainee temporarily present in the U.S. under a "J" or "Q" visa, who substantially complies with the requirements of the visa.
A student temporarily present in the U.S. under an "F," "J," "M," or "Q" visa, who substantially complies with the requirements of the visa.
A professional athlete temporarily in the U.S. to compete in a charitable sports event."