Most of the time you can use both with no difference in meaning. It's not an area where students make noticeable errors, so I wouldn't worry about it too much.
past progressive: 'at 10:15, Dan was typing on his computer.' -action was in progress at that time (10:15) past perfect progressive: At 10:15, Dan had been typing for 15 minutes. -action started 15 minutes before 10:15 and continued to 10:15. -past perfect progressive stresses 'how long'