So, i know that if a person is killed unjustly then all his sins will be given to his/her murderer. so what if a non muslim is killed unjustly, would all his sins go to his/her murderer and in that case would he still be put in Jahannam?
The notion that we inherit the sins of someone wrongly killed (or any other crime for that matter) is not based on Islam; every person is answerable for their own doing. No person transmits their sin to another. This is clearly delineated in multiple verses in the Qur’an (e.g. 6:164, 17:15, 35:18, 39:7, 41:46, 53:36). Keeping these verses in perspective, it should be obvious that your overall query is founded on some sort of misunderstanding. The second portion of your question is answered by the fact that such a belief does not exist in Islam; therefore, being non-Muslim is irrelevant to the overall context.
There is something important in your question, however, that needs to be addressed and has fundamental implications. Had your assertion been true – that one may bear the sins of another – then we would have to find some basis that Muslims and non-Muslims would be treated differently for the same crime. You can be certain that such a concept has no support in the Qur’an. In fact, it runs counter to the teachings of Islam. The Qur’an has reprimanded the people of other religions about their wishful belief of exclusivity:
وَقَالُوا لَن يَدْخُلَ الْجَنَّةَ إِلَّا مَن كَانَ هُودًا أَوْ نَصَارَىٰ ۗ تِلْكَ أَمَانِيُّهُمْ ۗ قُلْ هَاتُوا بُرْهَانَكُمْ إِن كُنتُمْ صَادِقِينَAnd they [who are Jews and Christians respectively] say, “No one will enter heaven unless they were a Jew; or Christian.” Such is their wishful thinking. Say to them [Prophet]: “Present your evidence if you are so sure [about your claims]. -Al Baqarah 2:111
While this verse is in reference to heaven, the overall context is that there were Jews and Christians who believed that because of their religious affiliation they were special and entitled to the ultimate reward. Unfortunately, Muslims have fallen into this hubristic belief as well. The fact is, God judges based on beliefs and works and takes into consideration things we cannot fathom. There is no Jewish or Christian or Muslim or any other religious standard. We are judged based on a divinely just and merciful scale. It is hard to digest that you are not any more special than a person of a different faith, even if your faith is the most accurate. At first glance, it almost seems counter intuitive unless we reflect on what being “special” really means. The verses of the Qur’an tell us who is “special” by underscoring that we bear our own burdens and that each individual will be judged based on their deeds (good and bad) and – most important to this point – it defines who the righteous are:
يَا أَيُّهَا النَّاسُ إِنَّا خَلَقْنَاكُم مِّن ذَكَرٍ وَأُنثَىٰ وَجَعَلْنَاكُمْ شُعُوبًا وَقَبَائِلَ لِتَعَارَفُوا ۚ إِنَّ أَكْرَمَكُمْ عِندَ اللَّـهِ أَتْقَاكُمْ ۚ إِنَّ اللَّـهَ عَلِيمٌ خَبِيرٌ[Hear], O you humankind! Indeed, We have created [each of] you from a male and female and propagated you into nations and communities so that you may be acquainted [with each other]. Surely, those honored by God are the pious [-He knows them well-] for God is the [supremely] cognizant, all-knowing. -Al Hujurat 49:13
The above verse is not directed at one or another group but all of humanity. It does not say “Muslims, God will honor you…” It is talking to the mortals of earth who behave in a godly way and no ethnic, cultural, class or religion is taken into consideration. The simple fact is, there is no exclusivity in Islam. Muslims are not automatic inheritors of God’s blessings or rewards. If we recognize this truth, then we should realize that being of the righteous means to work. It means one must be devout and do the best s/he can to bring themselves closer to God. We are not saved by the mere title we bear. We have a responsibility to the Almighty and to ourselves.
Exclusivity is dangerous to our individual psyche and detrimental to the overall community of Muslims. It doesn’t benefit anyone except those who uplift themselves with titles and ignore the grand picture. Being Muslim is a title we bear to identify our beliefs; with God titles don’t matter. It is how true we remained in faith and behavior to what we claim we are is what matters.
I hope this helps.
God knows best.