Assalamualaikum ustaz. What is the ruling for urine spatter because sometimes it is hard to avoid? Hope for an explanation.
Waalaikumussalam wrt. wbt.,
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions, and all those who follow his footsteps until the Final day.
We begin with Allah SWT’s statement:
إِنَّ اللَّهَ يُحِبُّ التَّوَّابِينَ وَيُحِبُّ الْمُتَطَهِّرِينَ
“Indeed, Allah loves those who are constantly repentant and loves those who purify themselves.” 
Al-Syaukani said the meaning of the above verse is Allah SWT loves those who repent from their sins and purify themselves from junub and hadas.  In other words, Allah SWT loves those who do a lot of istighfar and purify themselves by distancing themselves from filth and dirtiness. 
The valid conditions of prayer
Among the valid conditions of prayer is to be clean and free from najis on one’s body, clothing and place of prayer. It is understood that the najis has to be washed from one’s clothing based on the commandment of Rasullullah PBUH to Khaulah binti Yasar. Khaulah asked the Prophet PBUH:
يَا رَسُولَ اللهِ إِنَّهُ لَيْسَ لِي إِلاَّ ثَوْبٌ وَاحِدٌ وَأَنَا أَحِيضُ فِيهِ فَكَيْفَ أَصْنَعُ ؟ قَالَ : إِذَا طَهُرْتِ فَاغْسِلِيهِ، ثُمَّ صَلِّي فِيهِ
“Messenger of Allah, I have only one clothes and I menstruate in it, how should I do? He said: When you are purified, wash it and pray in it.” 
The above hadith shows that the Prophet PBUH commanded for the clothing worn to first be washed from any type of najis.
Urine is najis
Originally, human and animal urine is najis according to the hadith from Abu Hurairah RA, Rasullullah PBUH said:
وَهَرِيقُوا عَلَى بَوْلِهِ سَجْلاً مِنْ مَاءٍ
“And pour a bucket* of water over what he has passed,” 
Ibn Battal in his commentary stated that jurists have agreed that urine (human) is najis and the necessity to clean it. 
Likewise, al-Nawawi also said that all types of faeces and urine are considered as najis, regardless of whether the animal is permissible to be eaten or otherwise. 
Urine spatter that is hard to avoid
Hence, human urine is considered as najis and if it comes into contact with one’s clothing, body and place of prayer, then the prayer is invalid because being free from najis is one of the valid conditions of prayer. However, his prayer is valid if the spatter is too little, hard to avoid and isn’t visible. This is as stated by the author of the book al-Fiqh al-Manhaji:
“Islam is a clean religion. Hence, it is obligatory to remove najis no matter where it is. Maintaining oneself to be free from najis, clean and free from najis is a valid condition of prayer, whether it is on the clothing, body or place of prayer. Indeed, the religion also celebrates ease and remove burdens. Thus, some najis is forgiven due to the difficulty or burden to avoid the najis, in order to make it easy for people and ease their burden. For example, a little spatter of urine of which isn’t visible if it comes into contact with one’s clothing or body, whether it is mughallazah, mukhaffafah or mutawassitah najis.” 
Thus, Islam certainly commanded its ummah to always be in a pure and clean state in regards to his body and clothing before praying. However, this doesn’t mean a person should scrutinize every inch of his body to be free from najis until it burdens him from performing an act of worship. Hence, in a certain situation where it is out of our control or ability, then syarak forgives it.
Furthermore, we would also like to advise all of us to be moderate in everything that we do. In other words, don’t be negligent in matters of najis, especially when one is urinating or defecating by not being careful as to avoid any spatters or others, and also don’t be too cautious that it will burden us in performing any worship.
May Allah SWT grant us all a clear understanding in religion. Amin.
 Surah al-Baqarah: 222
 See Zubdah al-Tafasir min Fath al-Qadir by al-Asyqar, pg. 44
 See Tafsir al-Muyassar, pg. 35
 Narrated by Abu Daud (365)
 Narrated by al-Bukhari (220)
 See Syarh Sahih al-Bukhari by Ibn Battal, 1/325
 See al-Majmu‘ Syarh al-Muhazzab, 2/550
 See al-Fiqh al-Manhaji, 1/43.