This is what people and friends have tried:
rsync -arv --exclude "/home/john/.ccache:/home/ben/build" /home/john /media/ben/thumbdrive/
To exclude multiple directories you just use multiple
--exclude=path switches. So the command from the question properly written is as follows:
rsync -arv --exclude=.ccache --exclude=build /home/john /media/john/thumbdrive/
Note: Use relative paths with exclude. The paths are relative to the source directory, here /home/john.
A big thank you for Ubuntu forums for the same!