I know that the amount of substance of Grignard reagent used is 5 moles. But the answer given is 2. Is this anything to do with 'equivalents'?
No you are right it should be five. there are three dissociative protons thus one from the secondary amine, and two from the hydroxy groups. These must be reacted first then you need two to react with the ester. The question was made by a human and the book answer of 2 is probably just an error from such.