How do I know if られる means passive or 'can do'?

彼は先生に褒められました makes sense as passive ('he was praised'), but I've also seen られる forms that just mean 'can'. Same ending, same conjugation — how do native speakers (or anyone) tell them apart in real time?
Post
沐學 Mizuru