Valmiki Ramayana Ayodhya Kanda Sarga 40 Shloka 6
Original Shlokaव्यसनी वा समृद्धो वा गतिरेष तवानघ। एष लोके सतां धर्मो यज्ज्येष्ठवशगो भवेत्।।2.40.6।।
1 source checked for this shloka
अनघ O sinless one, व्यसनी वा in adversity, समृद्धो वा or in prosperity, एषः this one, तव your, गतिः is refuge, ज्येष्ठवशगः following the eldest brother, भवेत् इति यत् if it happens, एषः this, लोके in this world, सताम् of virtuous men, धर्मः is the duty.
Rama is your refuge in times of adversity or prosperity, O sinless one To be obedient to the eldest (brother) is the duty of virtuous men in this world.