The term "a free hand" is not defined in the rules, so it is up to a GM; regardless, the second bullet of the War Caster feat does not help when casting the sunbeam spell
What we do know know from the rules on Spellcasting Components is that:
[...] If a spell requires a somatic component, the caster must have free use of at least one hand to perform these gestures.
A spellcaster must have a hand free to access a spell's material components -- or to hold a spellcasting focus -- but it can be the same hand that he or she uses to perform somatic components.
The sunbeam spell has both material and somatic components, so we can use one hand to perform both of them; the only requirement is that the hand be "free".
The rules never define the word "free" so it is left up to standard English; if your hand is free to do something, then it is "able or permitted to take a specified action." (definition from lexico).
Unless a specific rule says something, any rule regarding the "freeness" of a hand would be up to the GM
However, the sunbeam spell never says it requires a free hand
Note, the sunbeam spell has Verbal, Somatic, and Material components and its description states:
A beam of brilliant light flashes out from your hand in a 5-foot-wide, 60-foot-long line...
You can create a new line of radiance as your action on any turn until the spell ends...
For the duration, a mote of brilliant radiance shines in your hand...
No part of the spell requires that the hand emitting light must be free (the hand performing the material components, however, must be free). When things do require a free hand they typically say so (weapons are "handheld", components require a free hand, as does grappling). Thus it is likely that the spell does not require a free hand.
How does the War Caster feat interact?
Note, the War Caster feat states:
You can perform the somatic components of spells even when you have weapons or a shield in one or both hands.
This doesn't help us much at all, the spell still has material components and in order to use material components (or a focus) we would need a free hand. The feat only helps in two scenarios:
- You have a spell with Somatic components but not Material components. It allows you to use a hand that is holding something else to perform the components.
- You have a spell with all three but you have a focus engraved into a shield or some similar armor or weapon which you are already wielding. It allows you to use a hand that is holding something else to perform the Somatic components only.