Rhyme is primarily determined by the repetition of ending sounds in words, regardless of whether those syllables are stressed or unstressed. For example, in the pairs "hat" and "cat," and "running" and "funning," the endings sound alike, which creates the rhyme.
However, in poetry and song, the pattern of stressed and unstressed syllables is important for rhythm and meter, but it does not directly affect whether two words rhyme. Rhyme can occur with both stressed and unstressed syllables, as long as the sounds match. For instance, "lit" (unstressed) and "fit" (stressed) rhyme because their ending sounds are identical, despite the difference in stress.
So, in summary, rhyme is based on the similarity of sounds at the ends of words, while stressed and unstressed syllables relate more to the rhythm and meter of the verse.