AFAIK, onboard the plane when the engines are running (so as to take advantage of the aggressive air filtration and renewal systems) is safest. Otherwise, crowded gate areas are not great, but crowded lounges are worse as most people won't be wearing a mask.