You've already got two conditions in there so you must know how to add further conditions. Just add the third like you added the second, simple
=COUNTIFS(Details!C:C,"Out of Compliance Contracts", Details!A:A,IF($C$5="Grand Total","?*",$C$5),D:D,"CURRENT MONTH" )