You have given a very general description of your system. There are many ways you can go about it. Have you tried any approach yet? Are you having any problems with anything specific?
In general, I can only give you the advice that everything is up to you to define Conditions (IF THIS), Actions (THEN DO THIS), and Variables (data storage). For example, you could have an event that says "if your current quest amount is less than 5, then accept quest". Then if the current quest amount is 5 , then this event won't run and the player won't be able to accept the quest.