Two men have been jailed after a shooting left a teenager with dozens of metal fragments in his body.