Most examples boil down to common sense. Nobody is going to arrest a 14 year old for driving their dying parent to the hospital.
Similarly, it is reprehensible but legal to pull up a chair and watch a child drown in a pool.
There is a difference between law and morality, and humans will use the second to selectively enforce the former.
In which country? Even for the US I don't believe the law system is that crappy.
- failure to render assistance ("unterlassene Hilfeleistung") up to one year in prison or a fine
- Exposed to a life-threatening situation ("Aussetzung", § 221 StGB) – If a person leaves someone helpless in a life-threatening situation, they could be sentenced to up to 10 years in prison
Edit: Also note that murder would often give you 16 years in germany even though it is called live long.