On the bike the blue wire is hot to tail light, the yellow is hot to brake light, black is ground.
On your new tail/brake light you have a red, green and black? I might think the red is tail, green is brake, or the green is tail and red is brake. Black is most often ground. Being as you are blowing fuses when you use the brakes indicates you have the yellow from the bike to ground on the new light. It probably has a ground through the mount as well as the black wire.
One easy way to tell is open up the new light and look at which wires go where. The ground wire is the one hooked to the body of the socket. The other two go to the dots that touch the bulb.
Once you figure out which wire is ground hook it to ground. Now with a jumper wire hooked to battery positive , touch the other two wires, one will light up very much brighter than the other. the bright one is brakes, the dimmer is the tail light.
Leo