Bash 4.2 + grep, 85 / 6! = 0.118
exec $((($1-126))&&echo "grep`seq $[$1&4]`"||echo /) -P "5{$1,1}"<<<$[2**63%(135-$1)] Supports exit codes 0, 1, 2, 126, 127, and 136.
Try it online! Currently working on a permalink.
How it works (incomplete)
grep will exit successfully (exit code 0) if it can find at least one match, fail (exit code 1) if there are no matches, and exit with 2 if there are any syntax errors.
For input 0, the pattern
$1{$1,1}becomes0{0,1}, which matches zero or one zeroes, so grep exits with 0.For input 1, the pattern becomes
1{1,1}, which fails with exit code 1 since there are no matches on STDIN.For input 2, the pattern becomes
2{2,1}, which fails with exit code 2 since the limits are out of order.