- It's your first offense
- You more-or-less admit to the crime (not necessarily meaning you turned yourself in, but you didn't go through a trial while maintaining your innocence the whole time)
- You are clearly remorseful
- The crime is minor and non-violent
- The odds are seen as low or very low that you'd do it again
There are exceptions of course, but if you commit armed robbery, I don't think many people would feel community service is a just sentence. Nor would shoplifting if it's the 5th time you've been caught.
There are significantly less guns available compared to the US, so armed robberies are likely heavily punished too.
While I don't say all sentences should be light as a feather, there are a lot of 'jails' (especially in Norway) where the inmates can go home for the evening or weekend.
I'm not even sure if just the implied threat of a weapon elevates it to armed robbery. But if you threaten somebody with a knife or club, I think you still get charged with armed robbery.
To use an apocryphal/urban legend example, if you stick a candy bar in a sweatshirt and point it at a cashier, that will receive the same punishment as if you pointed a loaded handgun at them.
- You are rich/famous.
Sure, "community service" might be a poor way to rehabilitate a long-term gang member, and some more extensive process might be needed to re-introduce them to society. But I wouldn't take it as far as saying nobody should ever feel sorry for them or that justice should seek to punish them instead of rehabilitating them. In fact, it seems to me like a tracking bracelet would be quite reasonable at some point in this process, since it would make them a liability for other gang members and thus help keep them away from that environment.
But that's a good thing unless you consider sending people to the mines and keep them locked behind bars for years a better alternative.