Understanding what makes someone immune is a crucial part of understanding how the vaccines should work. Currently, there are being clinical trials held for vaccine candidates. Scientist are using how our bodies protect itself against other diseases related to the coronaviruses to guide them on the answer to the vaccine for COVID-19. They found that the anti-bodies have shown that the pre-infected people have protection for a given amount of time.
Source: https://www.statnews.com/2020/06/11/coronavirus-immunity-vaccine-development/