He was tired because he was exercising so hard.This sentence emphasizes that he was tired because he was exercising at that exact moment.
He was tired because he had been exercising so hard.
This sentence emphasizes that he was tired because he had been exercising over a period of time. It is possible that he was still exercising at that moment OR that he had just finished.
Past continuous emphasizes interrupted actions, whereas past perfect continuous emphasizes a duration of time before something else in the past.