Obviously God is omnipotent so He cannot get tired and has no need to rest. It is a figurative expression indicating that creation was completed.
There is also some debate as to how to translate the word used there. While most translators go with “rested” others believe that “abstained” (from creating) is a better translation thus more clearly expressing that God had completed His creation.
In Jewish tradition it is said that God “rested/abstained” as an example to humanity that we who are in His image also need to rest/abstain from labor on occasion.