People in the second category are called "licensees." These are people who have the legal right to enter onto someone else's property, but their presence there does not really benefit or serve any purpose of the owner. Someone who has an easement over another person's property might be an example of a licensee. Like trespasssers, owners have no duty to make the premises safe for invitees. However, for dangerous conditions that are known to the owner, but not the licensee, the owner does have a duty to exercise reasonable care to make the condition safe or to warn the invitee of the danger. If the owner breaches that duty, then the owner may be held liable for injuries caused by the unsafe condition.
The final category is for "invitees." Invitees are people who have somehow been "invited" to enter the premises of the owner and have entered the premises pursuant to that invitation, such as a store that is "thrown open to the public" for shopping. This is a very general definition. The facts and circumstances of each case must be evaluated to determine whether a person is an invitee. If a person is an invitee, the owner owes a duty to maintain the premises in a reasonably safe condition. If the owner fails to maintain a safe place, and an injury results, the owner can ordinarily be held responsible for the injury. This can be a tricky area of the law and other elements of what I am discussing here exist. For instance, to prove that an owner failed to make the place reasonably safe, it must also be shown that the owner either (a) knew about the unsafe condition or (b) the unsafe condition existed for such a long period of time that the owner should have known about it. With respect to hidden dangers, the owner must give a warning of the danger. (A good example of this are the caution signs you see in stores when the floor has been mopped.) But the duty to warn does not apply to so-called "open and obvious" dangers. Under the law in Virginia, invitees must exercise reasonable care to watch where they are walking, and to take note of open and obvious dangers. If a person fails to do this, he or she may be barred from any recovery at all under the doctrine of "contributory negligence" in Virginia, which is the subject of another article to itself.
The foregoing article is a very high-level overview of the law that applies to these cases in Virginia. Any case involving an injury on another person's property must be evaluated on its own merits to determine if the owner of the premises may be liable.