The Virginia Supreme Court, in a landmark decision on homosexual rights and family law, ruled today that a parent cannot be declared unfit and permanently deprived of a child solely because he or she is homosexual.

The 5-to-2 decision overturned a lower court ruling that had stripped an Ohio woman of the right to ever see and communicate with her 11-year-old son. Her lawyers said she had been denied virtually any contact with the boy since that lower court ruling three years ago which also granted the father's second wife adoption of the child.

Although the Supreme Court emphasized today it did not condone the mother's homosexual life style, the decision written by Justice Albertis S. Harrison concluded: "We decline to hold that every lesbian mother or homosexual father is per se an unfit parent."

According to lawyers for the American Civil Liberties Union, which had argued the mother's case, the ruling is the first in the nation to uphold a homosexual's basic parental rights.

"If it had gone the other way it would have been an extremely damaging precedent," said Marcia Lowry, director of the ACLU's Children's Rights Project in New York. "We never saw this as a gay rights case; it's really about the right of a family to stay together."

Neither the mother nor her former husband, identified only as Jane and John Doe in court papers, could be reached for comment today. Lowry said the mother, who had waited two years for the court to rule on the case, had been stunned by the decision. "She said to me 'Now I've become a mother again,' " said Lowry of her client. "She was prepared to lose and she was almost speechless."

According to court papers, the Does were divorced in 1975 in Yellow Springs, Ohio. John Doe, a college professor, moved to Rocky Mount, Va., and remarried shortly afterward. The boy, identified as Jack Doe, continued to live with his mother.

The Virginia court said that, a year later, Doe and his new wife snatched the boy, taking him without Jane's consent to Virginia, where Doe sought and obtained permanent custody of the child. The mother was granted visitation rights at the time.

Two years later, Doe and his second wife filed in Virginia for adoption, charging Jane Doe's lesbianism had rendered her unfit to continue as Jack's legal mother. The couple's lawyer argued that the mother had flaunted her lesbianism by holding a "marriage ceremony" with her live-in lover and by openly expressing affection for the lover in front of the boy.

Jane Doe, a college educated interior decorator, brought a parade of witnesses from Yellow Springs who testified that she was an intelligent and loving mother. The Virginia commissioner of welfare agreed, rejecting the adoption petition. But a Franklin County Circuit Court judge overrruled the commissioner, saying that being exposed to the "open lesbian relationship . . . would result in serious emotional and mental harm to this child."

The state's high court disagreed today, saying that no evidence had been offered that the boy, an apparently happy and well adjusted child, had been harmed by his mother's lesbianism. "Regardless of how offensive we may find Jane's life style, its effect on her son's welfare is not a matter of which we can take judicial notice," said the court. It noted that even murderers and rapists are not presumed under the law to be unfit parents.

"Jane's unnatural life style was a proper factor to have been considered in determining her fitness as a mother . . . but standing alone as it does, it did not outweigh the clear and convincing evidence that she is a devoted mother and, in every other respect, a fit parent," said the court.

Lowry said the mother had been allowed to see her son only for a brief visit once during the summer of 1980 and again for a few hours last summer. She said the mother had been allowed to speak to the boy on the telephone only twice during that time. "I am glad the state Supreme Court recognized what an exemplary mother she is but that makes it ever more outrageous that she was denied three years of her son's life," said Lowry.

Under the court's ruling, the father and stepmother will retain custody of the boy, but he will be allowed to spend eight weeks during the summer with his natural mother along with alternate Christmas and Easter vacations. Lowry said her next step will be to secure a week's visitation this Christmas. David Melesco of Rocky Mount, lawyer for the father and stepmother, who now live in South Carolina, was not available for comment.