How many input fields in one row of a form?

I’m currently designing a template for forms on a governmental website. This kind of template can contain lots of input fields so I don’t want the user to scroll a lot. Also, the forms are in a slide-out pane (not on the full-screen, as you can see from the image I attached), so I have limited space. How many input fields should I put in one row? Right now I set “ID num”, “First Name” and “Last Name” aligned to the same row.

What do you think? Do you have any article or resource that talks about that?