It sounds that the kind and humane thing to do would be to put your dog to sleep. It is very sad, but it sounds like he is suffering. It would not be kind or fair to keep him alive.
There is NO humane way to put your dog to sleep at home. It is also illegal to put a dog down by yourself, without the aid of a vet. It is considered animal cruelty, because there is no safe and humane way to do it. You MUST bring your dog into the vet. They will give him a sedative so that he falls asleep peacefully as he dies. That is the only humane way to put a pet to sleep. Bring the poor baby to the vet!
(If you leave your dog to die by itself - it is also cruel because it will be a painful death. Just bring him to a vet!)