I've had nails break off when they arent trimmed or worn down naturally, usually indoor dogs, but never down to the quick like that one is.
Low pile carpet is a mother on a dogs nails, especially if not kept trimmed real short.
Looks like he may have snagged it while running and pulled it off.
Have you put anything on it such as neosporin?
The neo with pain relief should be safe for him and eliminate some of the tenderness.