I recommend formatting columns C-F as text, not date&time, so there will be no date associated with the entries. It is not a requirement, though.
=IFERROR(MOD(DUR2HOURS(D14−C14),24),0)+IFERROR(MOD(DUR2HOURS(F14−E14),24),0)
This works even when the log-out time is earlier than the log-in time, like when logging out after midnight.
This formula does not check that the entries are valid times of day. If a time was not entered in correct format to be interpreted as a time of day, that set of log-in and log-out times will be ignored (no hours worked). If you need those input errors to be flagged, the formula can be rewritten as
=IF(AND(C14≠"",D14≠""),MOD(DUR2HOURS(D14−C14),24),0)+IF(AND(E14≠"",F14≠""),MOD(DUR2HOURS(F14−E14),24),0)
The formula result will be an error if the inputs are not all times of day.