Take a look at the calorie calculation here: www.sparkpeople.com/resource/calorie_calcu
From the above calculation you can find out your maintenance calories, and consider a 500kCal daily deficiency and the calories you have burned to find out how much you should be eating that day. That means, you would have to eat more if you burn too many calories, but there is no such thing as eating all the exercise calories back.
Alternatively you can also use the concept of "net calories" to find out how much more you should be eating in case you burn too many calories, but there is no advantage to that calculation over the one that the above link points to.
"Eating back all exercise calories" is not a general rule. The general rule is, if you want to lose fat gradually, you create a 500kCal deficiency every day through eating less or exercising or a combination of both. If you create a larger deficiency, you would still lose fat, but that would be too hard for you and thus unsustainable. If you create a smaller deficit, that would be better for developing good habits for a healthier life, but it will take longer to lose the same amount of fat and can exhaust your patience.