I think at this time, no matter how old he is, whether he can understand or not, it is best to give him a physiology lesson first. Even if he has a little knowledge, let him realize the most basic essence of men and women, and he can observe his own body structure. He is both a father and a mother. If he doesn't realize you, he will be shy.
First, I taught him to know men and women and confirmed that he was a boy. Then I explained to him why he was raised as a girl when he was young.
After that, you can put some small picture books at home for both boys and girls. Although he was brought up as a girl, he must have a boy's nature. Let him see for himself, and then tell him to complete a gender classification through his parents, so that he can distinguish between boys and girls.
Parents can take him to play some games that little girls can't usually play, cultivate his temperament and transfer his temperament to boys.
Usually tell him that you are a boy. In this case, for example, if you ask your child to help clean up the housework, you can say that my son is great, worthy of being a boy, considerate of his mother and a man with indomitable spirit.
In the meantime, it is best not to mention that he is a girl, and relatives and friends should not make fun of him, even joking. If he is told that his attitude is not firm enough, he will be confused and shaken. It was originally intended to subvert his previous cognition. If his parents are not firm and say that he is a girl, it may be really difficult to turn around.
In this daily life, he is constantly instilled with the consciousness that he is a boy. After a long time, his own ideas will shift to the boys.