A 34-year-old banker yesterday announced his candidacy for the Republican nomination for Montgomery County executive but was told he is ineligible to run because he has not lived in the county long enough.

Joseph C. McGrath, a vice president of the American Security Bank, was told by the County Board of Elections that he fails to meet a provision that requires candidates to have been voters in the county for at least five years.

McGrath, who has lived in Montgomery for four years, said he plans to file a federal court suit to win the right to run. "As far as I'm concerned, I'm a candidate," he said, adding that an Anne Arundel County man had fought a similar restriction in 1978 and won his case in federal court.

In another political development, the "Jack Hewitt for County Executive Committee" has been formed. Hewitt, who ran unsuccessfully for executive as a Democrat in 1974, once served as executive director of the Maryland-National Capital Park and Planning Commission.

Hewitt said, "There are a lot of people urging me to run," and added that he had not instigated the committee's formation.

The committee was formed by a Democrat and a Republican, one of whom, Vera Wixon, first vice president of the Montgomery County Federation of Republican Women, sidestepped questions of whether Hewitt would become a Republican if he decides to run. "We're just going to find out what the lay of the land is," she said.