Yes, he can layer web on the roof, that he technically cannot see.
Web (1) targets (2) a point of origin for an area of effect (3) (within your range).
You have to be able to target a specific point which requires a clear path (4), which you have, the web spell then fills a 20- foot cube (5) from that point. You are not required to see the complete area of effect. So you are not required to see the anchoring points for the layering.
So how does my spell expand if I don't know where the anchoring points are?
After you have determined the point of origin, the spell’s effect expands in straight lines from the point of origin (3). The point of origin is the only requirement for targeting the spell, the layering is part of the spell. You only decide the cube's point of origin. If the cube is not layered between two solid masses, it ends at the start of your next turn (1).
If you can't see the anchor points for the web, you are effectively guessing where they are and hoping or evaluating that the area you choose will touch those anchor points and allow the web spell to work for its entire duration. In your question, the caster has information of where the roof is based on the presumed height of the creature whose head they can see, so his risk of failing to anchor the spell to the roof is relatively low.
You conjure a mass of thick, sticky webbing at a point of your choice
within range. The webs fill a 20- foot cube from that point for the
If the webs aren't anchored between two solid masses (such as walls or trees) or layered across a floor, wall, or ceiling, the conjured web collapses on itself, and the spell ends at the start of your next turn.
Targets (2) (PHB 204):
A typical spell requires you to pick one or more targets to be
affected by the spell’s magic. A spell's description tells you whether
the spell targets creatures, objects, or a point of origin for an area
of effect (described below).
Areas of Effect (3) (PHB 204):
A spell’s effect expands in straight lines from the point of origin.
If no unblocked straight line extends from the point of origin to a
location within the area of effect, that location isn’t included in
the spell’s area. To block one of these imaginary lines, an
obstruction must provide total cover, as explained in chapter 9.
A Clear Path to the Target (4) (PHB 204):
To target something, you must have a clear path to it, so it can’t be
behind total cover. If you place an area of effect at a point that you
can’t see and an obstruction, such as a wall, is between you and that
point, the point of origin comes into being on the near side of that
Cube (5) (PHB 204):
You select a cube’s point of origin, which lies anywhere on a face of
the cubic effect. The cube’s size is expressed as the length of each
side. A cube’s point of origin is not included in the cube’s area of
effect, unless you decide otherwise.
Thank you, Ryan Thompson, for significantly improving this answer.