A total of 162 persons who were demonstrating on behalf of the nation's homeless and unemployed were arrested yesterday after they refused to leave the Capitol Rotunda.

William McDermott, general counsel of the U.S. Capitol Police, said 158 adults and four juveniles were charged with unlawful assembly and were being processed last night at Washington police stations. Rich Miller, of the Community for Creative Non-Violence (CCNV), said most of those arrested posted $10 collateral bonds.

Among those arrested were Mitch Snyder, chief spokesman for the CCNV; the Rev. Fred Shuttlesworth of Cincinnati, a former aide to the Rev. Martin Luther King Jr., and the Rev. Philip Berrigan.

The CCNV had sponsored what it termed "The People's State of the Union" protest, which began at about noon on the west lawn of the Capitol and attracted about 300 people, according to McDermott.

About 2 p.m., most of the demonstrators laid down their placards and bullhorns and went into the Capitol Rotunda, McDermott said.

There, the group sat down and "announced their intention not to leave until Congress declares a national state of emergency concerning the homeless and Congress takes some steps to address that reality," according to Miller.

Miller said that Capitol Police had been alerted to the group's sit-in plans. When the police and other security officials began to close off the entire Capitol in preparation for President Reagan's State of the Union address, about half of the demonstrators refused to leave, Miller said.

Those who did not post bond will be arraigned today, police said.