Think of it more like "We had already been there two hours when she arrived." versus "We have been here two hours." It is probably a difficult distinction for a non-native to learn, but it's also kind of an advanced topic, and not one that you should feel as if you must master immediately to converse succesfully in English! :)