  We study the flavor dependent $U(1)_{B_i-L_j}$ models, where an $i$th
generation of quarks and $j(\neq i)$th generation of leptons are charged. By
solving the anomaly free condition for the matter sector of the SM fermions and
three generations of right-handed (RH) neutrinos, we find that the $j$th
generation of RH neutrino is not necessarily charged under the $U(1)_{B_i-L_j}$
gauge symmetry with the charge $-1$ and the other (neither $i$th nor $j$th)
generation of RH neutrino can also be. As a general solution for the anomaly
cancellation conditions, the other two RN neutrinos than the charge $-1$ RH
neutrino may have non-vanishing charge and be stable due to the gauge
invariance, and hence it is a candidate for dark matter (DM) in our Universe.
We apply this result to a $B_3-L_2$ model and consider a light thermal DM and a
solution to the muon $g-2$ anomaly. We identify the parameter region to have
the DM mass range from MeV to sub-GeV and simultaneously solve the muon $g-2$
anomaly. We also derive the constraints on the gauge kinetic mixing parameter
by using the latest Borexino phase-II data.
