Heavy-duty vehicles are primarily powered by diesel fuel, emitting CO2 emissions regardless of the exhaust after-treatment system. Contrastingly, a hydrogen engine has the potential to decarbonize the transportation sector as hydrogen is a carbon free, renewable fuel. In this study, a multi-physics 1D simulation tool (GT-Power) is used to model the gas exchange process and performance prediction of a two-stroke hydrogen engine. The aim is to establish a maximum torque-level for a four-stroke hydrogen engine and then utilize different methods for two-stroke modeling to achieve similar torque by optimizing the gas exchange process. A camless engine is used as base, enabling the flexibility to utilize approximately square valve lift profiles. The preliminary step is the GT-Power model validation, which has been done using diesel and hydrogen engines (single-cylinder heavy-duty) experiments at different operating points (871 rpm, 1200 rpm, 1259 rpm, and 1508 rpm). Thereafter, the validated model is used to simulate four-stroke hydrogen engine performance at different intake and exhaust pressures. The last step was to modify the model to operate in two-stroke mode. The intake and exhaust valve closing timings, pressure differential, and air-fuel equivalence ratio were varied to investigate the delivery ratio, charging efficiency, trapping efficiency, and scavenging efficiency for perfect displacement and perfect mixing modes. The variable valve-actuated camless two-stroke hydrogen engine achieved similar torque to that of a conventional cam-operated four-stroke hydrogen engine by optimizing valve timings, pressure differential, and in-cylinder air-fuel mixture proportions.