problem with 要 - it seems to have several meanings 一看见这些楼房，他心里就想，自己一定要买上一套房子。

This is the sentence that I've come across.  I've translated it as:

Once he sees these houses, he thinks that he can definitely buy a house himself.

But I'm always confused by 要.  I seems to have several meanings... 'to want to', 'will' and I suspect, in different contexts it has some grammatical meaning.

In this context it seems to mean 'will', though I'd always learnt 要 as meaning 'want to'. 

Any guidelines here?
I would translate 一定要 as "must":

Seeing those houses, he thought, "I must buy myself a house!"

要 indeed has several meanings. I'm not sure I'd call that a "problem", but it can be challenging for a learner. I think the most basic meanings are "want", "must", and occasionally "will". Just my 2 cents.