Valmiki Ramayana Yuddha Kanda Sarga 87 Shloka 15
Original Shlokaगुणवान्वापरजनःस्वजनोनिर्गुणोऽपिवा । निर्गुणःस्वजनःश्रेयान् यःपरःपरएवसः ।।6.87.15।।
1 source checked for this shloka
परजनः others, गुणवान्वा virtuous, स्वजनः own people, निर्गुणोपिवा not virtuous also, निर्गुणः not virtuous, स्वजनः own people, श्रेयान् welfare, यः that which, परः others, सः he, परएवहि even if he
"Even if others are virtuous and your own people are not virtuous also one should seek the refuge of one's own people. Strangers are always strangers."