Dreams of changing gender (for example, a girl dreams she is a boy) are very common.
These other “selves” simply represent feelings or thoughts that come from a side of your personality that you regard as being “male” (or in a boy’s case, female).
There in many characteristics that we associate with a particular gender, such as aggression being male.
It is normal and natural for this to be played out in your dream as you becoming the opposite gender.
It helps you to explore or act out feelings, or burn off negative thoughts, that you would otherwise repress.