There are 2 parties covered in the h264 license: the entity who sells a h264 encoder and the entity who distributes h264-encoded videos to consumer and charges for this.
Noncommercial use of h264 is free. The distribution of h264 encoders within OBS is free, because OBS itself is free and only has free editions. That's why almost all demo versions of commercial software usually have the h264 encoder removed: the companies doesn't want to pay for encoders they deliver in demo versions. But since OBS is completely free, the h264 encoder within is completely free as well.
Recording a h264 video with OBS is free, because you are not distributing it to end users.
Giving h264-encoded videos away for free is free.
Putting h264-encoded videos to Youtube is free, regardless of you monetizing the video or not, because Youtube isn't consuming (watching) the video. All intermediate steps between creating a video and consuming a video are free.
Youtube is using h264 to distribute videos to the people who watch the video and earns money by doing that, so Youtube has to pay a h264 license for this. You, who created the video and uploaded it to Youtube, don't have to pay. Youtube has to pay. And Youtube does pay and doesn't pass these costs to the uploaders.
So, in essence, you don't have to pay h264 license costs by recording h264 content with OBS. Giving away these videos for free also doesn't come with license fees. Selling these videos to end users require license fees. In case of video download portals, the portals are selling/distributing the videos to the end user, not the uploader, so the uploader doesn't have to pay a h264 license - the download portal has.
This is not a legal advice - it's only what I learnt about the h264 license.