Sahih Bukhari Volume 1, Book 1, Hadith Number 1

Narrated By ‘Umar bin Al-Khattab: I heard Allah’s Apostle ØµÙ„Ù‰ الله عليه وآله وسلم‎ saying, “The reward of deeds depends upon the intentions and every person will get the reward according to what he has intended. So whoever emigrated for worldly benefits or for a woman to marry, his emigration was for what he emigrated for.”

References

Reference: Sahih al-Bukhari 1
In-Book Reference: Sahih al-Bukhari Book 1 Hadith
1