Bring him to the vet. It could be bladder stones, or it may be disease. Perhaps there is something he ate that isn't passing through his system. But really, you should take him to the vet as soon as possible.
Has he been having diarrhea, or maybe has worms irritating it,,or he might just need his anal glands expressed. The vet can take care of this. Good luck:)