The EULA states that you need to pay Epic 5% of the gross revenue attributable to your game. However you are exempt from this for the first $3,000.00 in gross revenue for each game per calendar quarter.
Note that gross revenue is not your profit. It is the amount of money generated by your game; if, for example, you sell your game on the iOS app store for $0.99, and you sell 4000 copies, that is a gross revenue of $3960.00 even though you actually see less than that due to Apple's cut. Epic's example is as follows:
The royalty is based on gross revenue from end users, regardless of
whether you sell your Product to end users directly, self-publish via
the App Store or any similar store, or work with a publisher. The
following simplified example illustrates the application of the
royalty to gross sales: if your Product earns $10 on the App Store,
Apple may pay you $7 (having deducted 30% as a distribution fee), but
your royalty to Epic would still be 5% of $10 (or $0.50).
As to your specific questions:
What about if my game just made $300? Do I still need to pay 5%
royalties to them?
No. If your game has a gross revenue of $300 total, or $300 per quarter, you do not owe any royalties to Epic.
And how many times should I pay? For example, I made a game that was
sold for above $3000 so I paid 5% royalties but do I still need to pay
it again for the same game?
If your game has a gross revenue of $3001 in one quarter, you have to pay Epic 5% of the $1. If your game has a gross revenue of $0 the next quarter, you don't owe Epic anything for that quarter. The royalties are all based around a quarterly model.
You have to consider each game separately, not in total. If you have two games that move $3000 in a quarter, you don't owe any royalties. If you have two games that move $3001 in a quarter, you owe 5% of the extra $1 twice (one for each game).
It is also important to note that Epic considers in-app purchase revenue and ad revenue part of the gross revenue for royalty-computation purposes, so it's not only the initial sales of your game that factor in.