Yes they should get XP for the encounter, but it should be divided between the NPC + Party
Dragon Heist gives you the option of either using XP based advancement, or using milestone advancement. If you choose to use XP based advancement (which you clearly have) then you should be dividing out XP for the encounter as a whole.
Based on your description I believe the encounter in question is the
Troll and 3 stirges
While your party did not actually fight the
Troll
due to lack of opportunity they did participate in the encounter. In particular they stopped
3 stirges from dogpiling on Durnan while Durnan fought the Troll.
Similarly,
Durnan
prevented the PCs from being attacked by the
Troll
Finally the module expects the PCs to be thanked by
Durnan
for their help in the encounter, and stabilised if they have been reduced to 0 HP.
One thing to remember is that the
Troll regenerates back if it isn't hit by fire when it's at 0 HP. Durnan has no way (as written) to deal that fire damage, so he needs help from somewhere to actually deal the fire damage. The module mentions Durnan dousing the Troll in lamp oil, but that should have at least taken one of his 4 attacks. If you allowed Durnan to throw the lamp oil and make four attacks then you changed the action economy of the fight.
As you mention, the
Troll
is at half it's hitpoints when the encounter starts. This does (technically) reduce it's defensive challenge rating, which will then have a knock on effect on it's overall challenge rating. I have the calculations for this at home and will dig them out (later). This does add additional complications to the calculation though.
You always have the option of not dealing with this complication, and just awarding the normal XP for the monster.
If we use the normal XP for a full health monster, the total XP for the encounter is:
1800 + 3 * 25 = 1875
If we assume you are playing with 4 party members then the encounter XP should be divided by 5 to get the per player XP.
The would mean each player should be awarded
375 XP for the encounter
If you don't include the
Troll
And treat them as two separate encounters, then they would get
18 XP each. (75/4 = 18.75 which is rounded down to 18)
But, they didn't actually hit it?!!
Lets take this argument to the extreme. If you have an encounter setup for your party which has 50 goblins walk around a corner. Your party has a Sorcerer (or a Wizard) with fireball, who happens to roll high enough in initiative that they go before everything else in the encounter (both goblins and other PCs).
The Sorcerer seizes the moment and casts Fireball, incinerating all 50 goblins.
Should the other PCs in your party get an XP share? or should it all go to the Sorcerer?
To put it another way, if your party has an especially low Dex PC who doesn't roll high enough to participate in the encounter (the rest of your party are efficient at their monster murdering). Should that low Dex PC be excluded from the XP calculation?