you get it by completing the special "today's oh my gosh"
You can evolve Riolu with the Sun Ribbon.
Some missions can give a reward. It can be a lunar ribbon.
If you have Pokemon mystery dungeon explorers of sky after you complete the third special episode your rewarded a sun ribbon
In Explorers of Darkness you can get it as an occasional reward for completing a job. And in Explorers of Time, you can't get it, and have to get wondermail to get this reward.
you need a sun ribbon and its IQ needs to be 1 star
9866765498 if too long 9866765
find it in a dungeon
You use a lunar ribbon and you can only get a lunar ribbon in explorers of darkness and a sun ribbon (eevee evolves into espeon) in explorers of time
you have to have a razor fang and a lunar ribbon because normally they evolve with the razor fang at night
you have to find a sun ribbon which is only available in explorers of time.
get a sun ribbon and train for a while
bring him to luminous spring when his IQ is past 1 star and when you have a sun ribbon in your bag