The laws can vary from state to state on whether you're legally allowed to pull a gun on someone who enters your property.
If the person is not a threat to you then pulling a gun on the person could get you into trouble and certainly if you were to shoot the person who wasn't an actual threat to you could get you into trouble or even worse a murder charge if you killed the person.
In most states you can only pull a gun on someone who enters your house or land and is an actual threat to you such as if they pull a knife on you or they pull a gun out on you.
Then you can shoot the person.
If you feel threatened and pull a gun just in case then you usually will not get into trouble but don't point the gun at the person until they threaten you.