In principle, regular expressions do not count occurrences exactly (at least easily) internally, you might think of /(ATC.*ATC){1,1}/
but that does not work.
So it is easier to use a perl "one-liner", like so:
perl -e ' $x =()= "ATCGGGGGGATC" =~ /ATC/ig; print "pattern found\n" if $x == 2 '
This code is just for demonstration, you need to add file parsing and output behavior depending on your requirements.
In case the pattern could overlap, like in find exactly 2x ATCATC
and you want to include [ATC[ATC]ATC] as a valid hit, an additional check is required.
An alternative for making a regex that works in perl is to specify which pattern not to match in parts of the string, like so:
perl -e 'print "found\n" if "ATCATATC" =~ /^(?:(?!ATC).)*ATC(?:(?!ATC).)*ATC(?:(?!ATC).)*$/;'
where (?:(?!ATC).)*
matches everything except ATC.