In real life, can the owner of the house be held civilly or criminally
liable in this situation?
On one hand, the pool did not have a fence despite it being legally
required. On the other, they did enter the property illegally.
Negligence Per Se And Attractive Nuisance
The doctrine you are considering first is called "negligence per se" and states that failure to follow a penal statute or other law or regulation is negligent as a matter of law if the harm caused by failing to take the action it mandates is the kind of harm that the statute was intended to prevent.
It isn't perfectly clear, but the answer to that is probably "no, this is not a negligence per se" case.
Laws requiring pools to be fenced are largely directed at a particular type of tortious conduct called an "attractive nuisance" that could cause, for example, children who can't swim to be attracted to a pool that is dangerous to them without supervision. These laws are not intended to protect adult robbers (if the person engaged in robbery were an armed seven years old, that might be another story). California, however, has discarded the attractive nuisance doctrine that used to be part of its law, in 1970, in the case of Beard v. Atchison.
Common Law Premises Liability In California
The common law duty that a property owner owes to trespassers is to keep it free of deadly traps. You have liability if you turn your lawn into a literal mine field full of explosive land mines. But, you did not at common law owe a duty of reasonable care to prevent foreseeable accidental injury to trespassers such as robbers. So, there would be no common law duty here.
But, California has abandoned the strict common law distinction in premises liability between invitees, licensees, and trespassers in lieu of a general duty to use reasonable care that is fairly tailored to the precise circumstances of the accident. California Civil Jury Instruction No. 1001 (2000) citing Ann M. v.Pacific Plaza Shopping Center, 6 Cal.4th 666, 674-675, 25 Cal.Rptr.2d 137, 863 P.2d 207 (1993).
California, rather than focusing on the nature of the duty that the landlord owes to a trespasser, focuses more on this factor as part of the question of issues like whether the harm was foreseeable.
A Statute That Is On Point And Controlling Here
Despite this evolution in California's common law of premises liability, however, California does have a statute that singles out felons who are injured on someone else's property in the course of a felony, specifically, California Civil Code § 847, which states (emphasis added):
(a) An owner, including, but not limited to, a public entity, as
defined in Section 811.2 of the Government Code , of any estate or any
other interest in real property, whether possessory or nonpossessory,
shall not be liable to any person for any injury or death that occurs upon that property during the course of or after the commission
of any of the felonies set forth in subdivision (b) by the injured or
(b) The felonies to which the provisions of this section apply are the
following: (1) Murder or voluntary manslaughter; (2) mayhem; (3)
rape; (4) sodomy by force, violence, duress, menace, or threat of
great bodily harm; (5) oral copulation by force, violence, duress,
menace, or threat of great bodily harm; (6) lewd acts on a child
under the age of 14 years; (7) any felony punishable by death or
imprisonment in the state prison for life; (8) any other felony in
which the defendant inflicts great bodily injury on any person, other
than an accomplice, or any felony in which the defendant uses a
firearm; (9) attempted murder; (10) assault with intent to commit
rape or robbery; (11) assault with a deadly weapon or instrument on a
peace officer; (12) assault by a life prisoner on a noninmate; (13)
assault with a deadly weapon by an inmate; (14) arson; (15)
exploding a destructive device or any explosive with intent to injure;
(16) exploding a destructive device or any explosive causing great
bodily injury; (17) exploding a destructive device or any explosive
with intent to murder; (18) burglary; (19) robbery; (20)
kidnapping; (21) taking of a hostage by an inmate of a state prison;
(22) any felony in which the defendant personally used a dangerous or
deadly weapon; (23) selling, furnishing, administering, or providing
heroin, cocaine, or phencyclidine (PCP) to a minor; (24) grand theft
as defined in Sections 487 and 487a of the Penal Code ; and (25) any
attempt to commit a crime listed in this subdivision other than an
(c) The limitation on liability conferred by this section arises at
the moment the injured or deceased person commences the felony or
attempted felony and extends to the moment the injured or deceased
person is no longer upon the property.
(d) The limitation on liability conferred by this section applies only
when the injured or deceased person's conduct in furtherance of the
commission of a felony specified in subdivision (b) proximately or
legally causes the injury or death.
(e) The limitation on liability conferred by this section arises only
upon the charge of a felony listed in subdivision (b) and the
subsequent conviction of that felony or a lesser included felony or
misdemeanor arising from a charge of a felony listed in subdivision
(b). During the pendency of any such criminal action, a civil action
alleging this liability shall be abated and the statute of limitations
on the civil cause of action shall be tolled.
(f) This section does not limit the liability of an owner or an
owner's agent which otherwise exists for willful, wanton, or criminal
conduct, or for willful or malicious failure to guard or warn against
a dangerous condition, use, structure, or activity.
(g) The limitation on liability provided by this section shall be in
addition to any other available defense.
This statute is controlling and would probably immunize the property owner from liability in the fact pattern of the question. My initial review suggests that originally, it contained only parts (a) to (c) and (g) which are more emphatic. But, later, parts (d) to (f), which created narrow exceptions to this general rule, were added.