If you're in city limits in California then shooting a gun in your backyard would be illegal.
In most cities and towns it's illegal to discharge a firearm in your yard due to the potential to harm someone or kill someone accidentally from the stray bullets.
If you're in a rural part of California then discharging the firearm or shooting your gun in your backyard is legal as long as you're not shooting at people etc.
I've been to some rural parts of California with a friend and we did some shooting on his property and we had no issues.
But if you were to shoot the guns in town or a city then you could get fined or face jail time.