@vvlad,
The
had version references events slightly earlier in time. But it's a bare shade of meaning and you probably won't get into much trouble if you use them interchangeably.
Has been sleeping is more for, the guy just woke up, he's yawning and calling for a cup of coffee. Had been is a few minutes later. It's a little more for when he's in the middle of his first cup of coffee.