Section 8. Each committee existing at the time when the party which it represents first polls for any office to be filled by all the voters of the commonwealth at a biennial state election three per cent of the entire vote cast in the commonwealth for that office, and each committee existing at the time when the party it represents first polls for mayor or a selectman at a city or town election at least three per cent of the entire vote cast in the city or town for that office, shall be deemed elected under this chapter, and shall be subject to its provisions.