Keeping Dogs in Islam: Allowed?
Question

Keeping a dog is najis & if a Muslim man keeps a dog just to guard the house, outside the house - puts the dog at the end of the compound, how should he cleans himself? What if he cannot find any earth or mud to clean himself? Is there another alternative way of cleaning himself? Sometimes, he takes the dog for jogging, pats the dog, kisses the dog etc.
Praise be to Allah.Is keeping dogs haram in Islam?
Islam forbids Muslims to keep dogs, and the punishment for that is that the one who does that loses one or two qirats from his hasanat (good deeds) each day. An exception has been made in the case of keeping dogs for hunting, guarding livestock and guarding crops . 
Abu Hurayrah (may Allah be pleased with him) narrated that the Prophet (peace and blessings of Allah be upon him) said: “Whoever keeps a dog, except a dog for herding, hunting or farming, one qirat will be deducted from his reward each day.” Narrated by Muslim, 1575. 
 ‘Abd-Allah ibn ‘Umar (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings of Allah be upon him) said: “Whoever keeps a dog, except a dog for herding livestock or a dog that is trained for hunting, two qirats will be deducted from his reward each day.” Narrated by al-Bukhari, 5163; Muslim, 1574. 
Is it permissible to keep a dog to guard houses? 
Al-Nawawi said: 
“There is a difference of opinion as to whether it is permissible to keep dogs for purposes other than these three, such as for guarding houses and roads . The most correct view is that it is permissible, by analogy with these three and based on the reason that is to be understood from the hadith, which is necessity.” (Sharh Muslim, 10/236)
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) said: 
“Based on this, if a house is in the middle of the city there is no need to keep a dog to guard it, so keeping a dog for this purpose in such situations is haram and is not permitted, and it detracts one or two qirats from a person’s reward every day. They should get rid of this dog and not keep it. But if the house is in the countryside and there is no one else around, then it is permissible to keep a dog to guard the house and the people who are in it; guarding the members of the household is more important than guarding livestock or crops.” (Majmu’ Fatawa Ibn ‘Uthaymin, 4/246)
Does one lose one qirat or two qirats if he keeps a dog?
There are several scholarly views about reconciling the reports which say “one qirat” and those which say “two qirats”. 
Al-Hafiz al-‘Ayni (may Allah have mercy on him) said: 

It may be that they have to do with two types of dogs, one of which could cause more harm than the other.
It was said that “two qirats” applies in cities and villages, and “one qirat” applies in the countryside.

It was said that they were said at two different times – “one qirat” was mentioned first, then the warning was made more strict and two qirats were mentioned. (‘Umdat al-Qari, 12/158)
Are dogs impure?
With regard to the words of the questioner, “keeping a dog is najis”. This is not exactly correct, because the najasah (impurity) is not in the dog itself, rather it is in its saliva when it drinks from a vessel. 
Does touching or kissing a dog require purification?
If a person touches a dog or a dog touches him, that does not mean that he has to purify himself, whether with soil or water. But if a dog drinks from his vessel, then he has to throw away the water and wash it seven times with water and the eighth time with soil, if he wants to use it. If he makes it just for the dog then he does not have to purify it. 
It was narrated from Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings of Allaah be upon him) said: “The purification of the vessel of one of you, if a dog licks it, is to wash it seven times, the first time with soil.” Nararted by Muslim, 279. 
And according to another report by Muslim (280): “If a dog licks the vessel of one of you, let him wash it seven times and rub it with soil the eighth time.” 
Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) said: 
“With regard to dogs, there are three views among the scholars: 
1 – That they are tahir (pure), even their saliva . This is the view of Malik.
2 – That they are najis (impure), even their hair. This is the view of al-Shafi'i and is one of the two views narrated from Ahmad.
3 – Their hair is tahir but their saliva is najis. This is the view of Abu Haneefah and of Ahmad in the other report narrated from him. 
This is the most correct view. So if the wetness of the dog’s hair gets onto one’s garment or body, that does not make it najis.” (Majmu’ al-Fatawa, 21/530. 
Elsewhere he said: 
“That is because the basic principle is that substances are tahir, and it is not permissible to regard anything as najis or haram without evidence, as Allah says (interpretation of the meaning): 
“while He has explained to you in detail what is forbidden to you, except under compulsion of necessity?” [al-An’am 6:119] 
“And Allah will never lead a people astray after He has guided them until He makes clear to them as to what they should avoid” [al-Tawbah 9:115]
The Prophet (peace and blessings of Allah be upon him) said: “The purification of the vessel of one of you, if a dog licks it, is to wash it seven times, the first time with soil” – and in another hadith, “If a dog licks a vessel…” All of the ahadith mention licking only; they do not mention any other part of the dog, regarding them as najis is based only on analogy. 
Moreover, the Prophet (peace and blessings of Allah be upon him) granted a concession allowing people to keep dogs for hunting, herding and farming. The one who keeps them must touch the wetness of their hair, just as happens in the case of mules, donkeys, etc. To suggest that their hair is najis when touching them cannot be avoided could impose undue hardship, which is not what the Lawgiver intended for this ummah.” (Majmu’ al-Fatawa, 21/217, 218)
To be on the safe side it is better, if a person touches a dog and there is something wet on his hand, or if there is something wet on the dog, to wash his hand seven times, one of which should be with soil. 
Shaykh Ibn ‘Uthaymin said: 
“With regard to touching this dog, if there is no wetness then it does not make the hand najis, but if he touches it and there is any wetness, then this means that the hand becomes najis according to the view of many scholars, and the hand must be washed after that seven times, one of which should be with soil.” (Majmu’ Fatawa Ibn ‘Uthaymin, 11/246)
How do you clean dog saliva?
With regard to the way in which purification from the najasah of a dog is to be done, this has been explained in the answers to questions no. 41090  and 46314 . 
What must be done is to wash off the najasah of a dog seven times, one of which should be with soil. If soil is available then it must be used, and nothing else will do. If no soil is available, then there is nothing wrong with using some other cleaning agent such as soap.
Animal diseases that affect humans 
What the questioner mentions about kissing the dog is something that causes many diseases. The diseases that people may get as the result of going against shari’ah by kissing dogs or drinking from their vessels before purifying them are many, such as pasteurella which is a bacterial disease, the cause of which exists naturally in the respiratory systems of humans and animals, but under certain circumstances this germ can invade the body and cause disease.
Another of these diseases is a parasitic disease that affects the intestines of humans and animals, and usually affects the liver and lungs, the abdominal cavity and the rest of the body.
This disease is caused by tapeworms, which are small worms 2-9 millimeters long, which are formed of three sections, a head and a neck; the head has four suckers.
The adult worms live in the intestines of their hosts, such as dogs, cats, crows and wolves.
This disease is transmitted to humans who love dogs, when they kiss them or drink from their vessels.
See: Amrad al-hayawanat allati tusib al-insan (Animal diseases that affect humans) by Dr. ‘Ali Isma’il ‘Ubayd al-Snafi.
Conclusion
It is not permissible to keep dogs except for hunting or guarding livestock and crops, and it is permissible to keep them for guarding houses so long as that is outside the city and that there is no other means of guarding the house. The Muslim should not imitate the kuffar by running with the dog or touching its mouth and kissing it, which causes many diseases.
Thanks are due to Allah for granting us this pure and perfect shari’ah, which came to set people’s spiritual and worldly affairs straight, but most people do not realize.
And Allah knows best.