The correct sentence is:
Me lastimé el tobillo cuando estaba jugando fútbol.
This sentence uses the preterite tense "lastimé," which is appropriate for indicating that the action (injuring the ankle) happened in the past while another action (playing soccer) was occurring.