You need to use the NETWORKDAYS function, so try this:

=IF(G12="","",IF(H12="",NETWORKDAYS(G12,$S$1),NETWORKDAYS(G12,H12)))

Note that the start date comes before the end date in the parameter list. You can also take account of any holidays that are scheduled.

Hope this helps.

Pete