Authorities say Eduardo A. Leon broke into the singer's Hollywood Hills home on May 9, 2018.
He hopped a fence and spent about 12 hours inside the home before the singer's assistant discovered him and called police. Rihanna was not home at the time.
Leon has entered a plea to one felony count each of stalking and vandalism and a misdemeanor count of resisting arrest, according to the Los Angeles County District Attorney's Office.
Leon was sentenced to five years probation and placed on GPS monitoring for 90 days. He also must participate in programs for mental health and drug treatment.
He was ordered to stay away from Rihanna for 10 years and he is prohibited from using social media during the probation period.
If he violates the terms, he could face up to four years and eight months in state prison.