How can I show the leader's health of each team and make it say the other team won

I'm making a Minecraft mini-game called "Clan Wars". You have to try to kill the other team's leader then you team wins! The problem is I would like the scoreboard to show the leaders' health and under both leaders' health, show all the players and the team they are on. When the leader is dead on the red side, for example, it says blue won and teleports all the players back to the lobby. If you need more information, comment below and I will edit those details in soon!

{I would rather it not be a pressure plate because a player can still activate it}

I have tried looking up testfor commands to do something like [testfor entity=ocelot x z y] but it doesn't work


Solution 1:

I am assuming the leader is a player, not an entity.

Have a scoreboard objective of type health called whatever you want, and set the display to sidebar. Make sure the 2 teams have colored names. This will show health for everybody though. Also have an objective for death counts to keep track of when the leader dies.

COMMANDS:
/scoreboard objectives add health health Health - Make health objective
/scoreboard objectives setdisplay health sidebar - Set to sidebar
/scoreboard teams add red Red - Add team red
/scoreboard teams add redleader Red - Add team red's leader
/scoreboard teams add blueleader Blue - Add team blue's leader
/scoreboard teams option red color red - Set red name color to red
/scoreboard teams option blue color blue - Set blue name color to blue
/scoreboard teams option redleader color red - Set redleader name color to red
/scoreboard teams option blueleader color red - Set blueleader name color to blue

Then have a clock testing for a death.

COMMANDS:
/scoreboard objectives add death deathCount Deaths - Make deaths objective
testfor @a[score_death_min=1,team=redleader] - Output to whatever you want to happen when the red leader dies.
testfor @a[score_death_min=1,team=blueleader] - Output to whatever you want to happen when the blue leader dies.

Also don't forget to add all the people in the game to their teams!