It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "The example of a hypocrite is like that of a goat between two herds; sometimes it goes to one herd and sometimes to the other, and it does not know to which herd it belongs."
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 6298