||We extend the halo-based group finder developed by Yang et al. (2005c) to use data simultaneously with either photometric or spectroscopic redshifts. A mock galaxy redshift survey constructed from a high-resolution N-body simulation is used to evaluate the performance of this extended group finder. For galaxies with magnitude z <= 21 and redshift 0 < z <= 1.0 in the DESI legacy imaging surveys (the Legacy Surveys), our group finder successfully identifies more than 60% of the members in about 90% of halos with mass greater than or similar to 10(12.5) h(-1) M. Detected groups with mass greater than or similar to 10(12.0) h(-1) M have a purity (the fraction of true groups) greater than 90%. The halo mass assigned to each group has an uncertainty of about 0.2 dex at the high-mass end greater than or similar to 10(13.5) h(-1) M and 0.45 dex at the low-mass end. Groups with more than 10 members have a redshift accuracy of similar to 0.008. We apply this group finder to the Legacy Surveys DR8 and find 6.4 million groups with at least three members. About 500,000 of these groups have at least 10 members. The resulting catalog containing 3D coordinates, richness, halo masses, and total group luminosities is made publicly available.