I think an example would be - A- not castle doctrine- you set up a gun to fire if the door is opened, people with cabins who get broke into have done this and it is not considered 'castle doctrine'. It doesn't work because you are only protecting your 'stuff' not life itself.
B- you live in a house and keep a gun close by because your neighborhood is filled with crime. Somebody is attempting to get into your place and you truly believe they will harm you, you warn them and shoot, they die. In a case such as that you may use 'castle doctrine', not saying you will get off with it but you could use it. Depends on what part of the country & county you may be in. I think I remember a case of a grandma who called 911 while someone was attempting to break into her apartment through the glass doors. You can hear her telling the guy repeatedly "I'm going to shoot you!" still he came, she shot him, he died, she did not spend a day in jail.