We extend the halo-based group finder developed by Yang et al. (2005b) to use data {it simultaneously} with either photometric or spectroscopic redshifts. A mock galaxy redshift surveys constructed from a high-resolution N-body simulation is used to evaluate the performance of this extended group finder. For galaxies with magnitude ${rm zle 21}$ and redshift $0<zle 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 $ga 10^{12.5}msunh$. Detected groups with mass $ga 10^{12.0}msunh$ 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 $ga 10^{13.5}msunh$ and 0.45 dex at the low mass end. Groups with more than 10 members have a redshift accuracy of $sim 0.008$. We apply this group finder to the Legacy Surveys DR8 and find 6.4 Million groups with at least 3 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.