Lying is an evil and bad habit which leads one to sin and ultimately to the fire (Jahannum). This is proven from the following Hadeeth;
(2607) حدثنا زهير بن حرب، وعثمان بن أبي شيبة، وإسحاق بن إبراهيم – قال: إسحاق: أخبرنا، وقال الآخران: حدثنا – جرير، عن منصور، عن أبي وائل، عن عبد الله، قال: قال رسول الله صلى الله عليه وسلم: «إن الصدق يهدي إلى البر، وإن البر يهدي إلى الجنة، وإن الرجل ليصدق حتى يكتب صديقا، وإن الكذب يهدي إلى الفجور، وإن الفجور يهدي إلى النار، وإن الرجل ليكذب حتى يكتب كذابا» (صحيح مسلم)
Verily truthfulness guides a person towards righteousness, and verily righteousness directs one towards Jannat, a person speaks the truth until he becomes a truthful person. And verily falsehood directs one towards Jahannam, and verily a man lies to such an extent that he is recorded by Allah Ta’ala as a liar.
On the other hand, to cover the faults of a brother has tremendous rewards, if the action done is such that it causes harm to others as is in the Hadeeth of Sahih Muslim;
ومن ستر مسلما ستره الله يوم القيامة
“One who hides the faults of his brother, Allah will hide his faults on the day of Qiyaamah.”
Coming back to the query, lying is greatly abhorred in Islam, yet some concession has been given in Shari’ah for lying in certain confined situations. From amongst them, is to lie to hide the secret of a brother. Based on this, we would advise that if the person had told you a secret, then you should not divulge it to anyone as he has taken you in trust with regarding to it, unless if by you keeping the secret, it will lead to harming a fellow brother.
Regarding the fault or sin the brother has done, if the person asking is of such nature that he will be able to correct the person with the fault or help him in staying away from the sin, then it will be permissible to tell him. On the contrary if by telling the questioner about the fault or sin, it will not benefit the person with the fault or sin in anyway, then one should excuse oneself and not disclose anything.