In the general case, the exit code when a process is killed is unpredictable.
Bash takes care to set the exit code of a killed process to 128 + the signal it was killed by, so kill -9 will always cause Bash to report exit code 137.
With kill -9 in particular, the receiving process has absolutely no control over its exit code; it is simply killed immediately.
It is quite hard to argue that there would be any circumstances where a process should report success when it is forcibly interrupted, anyway. Though of course, if you have control over the source code of the process, you can make it explicitly exit 0 on some signals (though again, not for kill -9 which cannot be handled).
Aside: You should basically never use kill -9. It is an emergency stop which should only be utilized in unusual situations (and even then you should know what you are doing).
As a further aside, you want to remove the useless greps you have there.
for pid in $(ps -ef |
awk -v first="$1" -v second="$2" -v app="main-app" '
$0 ~ first && $0 ~ second && $0 ~ app && !/awk/ {print $2}')
do
kill "$pid"
done
The exit 0 you had in there would terminate the current shell (and of course, exit the loop).
Incidentally, the linked page also has a section about why to avoid kill -9.
kill -9. Clean up the receiving process so it handles SIGTERM and stop smashing it with a sledge hammer.