Experience and loot comes from damage to the monster so even when they heal themself the damage still counts so whoever does more damage will get more exp and win the monster/boss i know this because of Omrafir, my server is at war, what we do is deal 2k of SDs to Omrafir and leave it there so if the enemies try to kill it i will drop the loot to us (nightmare horn) because whoever does this did more damage even when it didnt even went down from stage 1.
Experecience works like that in every case but loot doesnt some boss with have their loot shared also ramdonly or by participation.
to answer your question about the dragon
a dragon gives exp of 700
so the first player deals 99% of damage of its health points
the second hits 100%
the experience by simply math will share 49% - 51%
meaning that the first player will get 343 of exp while the other will recieve 357 of exp
Hope it answer your question