''ie'' - pronunciation
When I started learning German, at first place, I learned that ''ie'' is pronounced as ''ee''. Now, I can hear some words where at the end of the word ''ie'' is pronounced like ''ihr (you)''. It doesn't have to be literally at the end of the word, but, for example, in the word ''die Familie'', ''ie'' is pronounced like ''ihr'' and in the word ''viel'' it's pronounced like ''ee''. So, my question is, is there any grammatical rule to explain this or you just have to remember the pronunciation of the each word? Thank you very much for your answer. :)