There are 2 methods to get this:
NewRepeat can be captured through segment or through plugin
Basically we are looking at the visit number of the visitors: if a visitor has at least one visit with a visit number higher than 1 (2 or higher) the visitor is segmented as “returning visitor”. All others are segmented as new visitors. Be aware that this is not depending on the timeframe you are looking at rather segmenting the visitors in their whole history i.e it would be dependent on ECID cookie…which is set for 2 years
Using plugin you can set your own cookie and set it according to your own time, which is generally 30 days, but can be anything as per the business vertical requirement.