Using "will" after "if"
Solution 1:
The rule you have been told has some validity, but is too general.
English speakers don't use a will with simple future meaning after if:
If the plan succeeds, I will come.
not
*If the plan will succeed, I will come.
But will can also convey intention or willingness, so with an animate subject (especially second person) will can work
If you will come, I will talk to you
meaning something like if you are willing to come.
So
If you jump, I'll catch you.
is normal, as is
If you fall, I'll catch you.
But while
*If you will fall, I'll catch you.
doesn't make sense,
If you will jump, I'll catch you.
can make sense, with the special meaning of if you are willing to jump - it's an invitation, or a dare.
Solution 2:
SUPPLEMENTARY to Colin Fine's answer:
Colin Fine explains the most common use of will in if clauses, which is the use in your example. There are other such situations:
-
when will is used emphatically in its habitual/insistent sense:
If you will keep bothering me with questions you must expect some answers you don't like.
-
when will is used in the ordinary futurive sense of a future eventuality accepted as factual. This use is often 'echoic', reflecting a previous speaker's use of will:
("John will be here tomorrow") —"Well, if John will be here tomorrow we'd better get that presentation done tonight."
-
when will is used to indicate an inherent quality or capacity:
If your car will hold all of us I don't need to take mine.