Ok I am confused what you actually what the program to do so I am just going to stab in the dark.
while (eHealth > 0)
eHealth - attack;
if (eHealth <= 0)
cout<< "You have killed the goblin."<< endl;
In your loop you are doing eHealth - attack.
So lets think about this, your doing the golbins health minus attack which is 1. Now you never store the 1 and it is just forgotten about. Now ehealth is greater than 0 because its still 8 because it is never saved. Now the program will go into an infinite loop.
However lets fix this and do eHealth = eHealth - attack;
eHealth = 1;
do if statement = no
eHealth = -6;
do if statement = yes
output "You killed the goblin \n"
add one to stats;
break while loop;
Additionally stats was never assigned so you will get a runtime failure, so if you change it to int stats = 0;
Ok your next question is going to be it comes up with but it also printed "You have died" this is becuase you have forgotten to add a break statement for the case of attacking the goblin. So it will execute case1 which you kill the goblin, it never finds a break to break the case so it does case2 also then case2 finds a break and finishs.