And to answer your specific question:
Case 1
I'm carring a ded guy's (DG) Body in Armor in from of me and another bad guy (BG) is trying to shoot me.
Since you are partially covered by the body and is aware of the attack you get to defend against the attack.
On the Defense Roll I got less successen than the BG.
Since you used a Take Cover action to take advantage of the body you carry in front of you, your defense test will gain a positive dice pool modifier (which will make it more likely that the attack will either completely miss or at least first hit the body in front of you).
As I'm carrying the Body it acts as my shield and got the bullet first
The attack will still first hit you and your body on a success.
The attack will only first penetrate the human shield on a tie.
SR5 p. 190 Cover
If you attack someone in cover and you tie in the Opposed Test, you hit your target through the cover she’s using. If you penetrate the barrier (see Barriers, p. 197), you can still do damage to your opponent.So I first roll DG's Body+Armor (-AP if, any)
If the target is alive, then yes. If the body is dead then you don't really need to worry how much damage it takes....
and then all the unresisted damage is then goes to me where I roll my own Body+Armor(-AP, if any).
No.
If the attacker is using a penetration weapon (for example firing bullets) then the attack will either be stopped cold by the barrier/body (if the modified DV of the attack is less or equal to the armor of the barrier/body) or the modified damage value will just be reduced by 1 and the rest will hit your body.
SR5 p. 198 Penetration Weapons
If the weapon you’re using is primarily a penetrating weapon, like a firearm or a pointed sword, then the barrier takes 1 box of unresisted damage (or no damage at all at the gamemaster’s discretion), allowing the rest to transfer to the target behind it....
This is only true for weapons whose modified DV exceeds the Armor rating of the barrier. As above, if the modified DV is less than the Armor, the attack is stopped dead with no damage to anything.Case 2
I'm carring a ded guy's (DG) Body in Armor in from of me and another bad guy (BG) is trying to shoot me.
Since you are partially covered by the body and is aware of the attack you get to defend against the attack.
First I get Defence Bonus as I'm behing the cover/barrier
Yes.
Since you used a Take Cover action to take advantage of the body you carry in front of you, your defense test will gain a positive dice pool modifier (which will make it more likely that the attack will either completely miss or at least first hit the body in front of you).
But the shooter still hits me and now I only rolls my own Body+Armor(-AP, if any).
Yes.
Unless the attack was a tie (maybe because the positive dice pool modifier on your defense test).
...in which case the attack will either be stopped cold by the barrier/body (if the modified DV of the attack is less or equal to the armor of the barrier/body) or the modified damage value will just be reduced by 1 and the rest will hit your body.