John 3 King James Version (KJV)
3 There was a man of the Pharisees, named Nicodemus, a ruler of the Jews:
2 The same came to Jesus by night, and said unto him, Rabbi, we know that thou art a teacher come from God: for no man can do these miracles that thou doest, except God be with him.
3 Jesus answered and said unto him, Verily, verily, I say unto thee, Except a man be born again, he cannot see the kingdom of God.
4 Nicodemus saith unto him, How can a man be born when he is old? can he enter the second time into his mother's womb, and be born?
A figure of speech is a departure from normal discourse for the purpose of emphasizing something. There are about 900 kinds of figures in the bible, and dozens of variations of some kinds. An idiom is a word or phrase that has a special meaning in a certain culture. "Born again" was an idiom unique to Nazareth. It meant to become childlike. Nicodemus was not from Nazareth so he had no clue that it had other than a literal meaning.
You might like to obtain "Figures Of sPeech In The Bible" by E. W. Bullinger. You can get a hard copy at any bookstore and free copies are available on line in various formats. Mr. Bullinger was an Anglican minister about a century ago.