Not sure where "denied boarding" comes into this as nowhere is it remotely suggested that OP's friend was denied boarding.
OP's friend was on flight 1 which was cancelled and he was apparently rebooked (OP says "joined" but we will presume this to mean rebooked) onto flight 2 which departed 5 hours late (let us presume that it arrived 5 hours late as well).
EC 261/2004 looks at the time of arrival at the final ticketed destination as compared to the originally scheduled time of arrival. That is a readily calculated number of hours and depending on whether this was a Type I, II or III flight, compensation of somewhere up to EUR 600 is due. In addition, BA had a "duty of care" which would cover meals and perhaps a hotel if an overnight was involved.
If OP would care to provide the specifics, a specific answer could be provided.