Can the spell be used only in buildings? Does the size of the building matter or does the spell work across the entire volume of the building? For example, would it be possible to use homenum revelio in the Ministry of Magic? What if the spell was used in the open? Does THE Invisibilty Cloak prove to be impervious against this spell? Is there any concrete proof that this spell can actually pierce the Cloak's protective enchantments?
Angela Morrissey: Why is it that albus dumbledore can see harry under his invisibility cloak at certain moments? (during the series is the cloak only infallible to those who do not own a deathly hallow).
J.K. Rowling: Dumbledore, who could perform magic without needing to say the incantation aloud, was using 'homenum revelio' – the human-presence-revealing spell Hermione makes use of in Deathly Hallows.
Albus Dumbledore sometimes uses Homenum revelio non-verbally on occasions when Harry Potter is concealed by his Invisibility Cloak, giving the Harry the impression that the Headmaster can see him through the Cloak (BLC, CS14, PS12).
BLC = Bloomsbury Live Chat
CS14 = Cornelius Fudge is the fourteenth chapter of Harry Potter and the Chamber of Secrets.
PS12 = The Mirror of Erised is the twelfth chapter of Harry Potter and the Philosopher's Stone.
Travers casts Homenum revelio while in Xenophilius Lovegood's house to find out whether Mr. Lovegood's is telling the truth about Harry Potter's presence in his house. Due to the Death Eater's affirmation, after using the spell, that there is "someone up there", when there were in fact three people, it is possible to assume that Homenum revelio does not reveal specifics about the people whose presence the spell detects (DH21).
DH21 = The Tale of the Three Brothers is the twenty-first chapter of Harry Potter and the Deathly Hallows.
It appears that the spell does attempt to search the entire volume and also indicates where (in general) the detected presence is located. As a result, Hermione did not say anything about Harry and Ron being detected, nor did Travers say anything about Lovegood because they could see the person being detected and could ignore the indication.
From the way it is written, it appears that it detects a human presence within a cetain range of the person casting the spell and it would not matter if it is inside or outside. However, it is not mentioned explicitly.
The fact that Dumbledore can detect Harry under the cloak and the way he uses it would seem to confirm this.
The Ministry of magic is probably warded against spells so it could not be used. Additionally, there are probably spell detector alarms in the building.
If there are offices with a night shift, the spell would always give a positive indication in any case.