I don't see any reason to do power factor correction for a house, since power companies don't normally charge for reactive power in a residence.
But if you need to, you would have to monitor the power factor (voltage phase angle versus current phase angle) and then sequentially connect the capacitors into the circuit for minimum phase difference.
You need an isolated current and voltage phase detection circuit. The voltage detection can be done with an opto isolator to detect the zero crossing. The current sensing can be done with a current transformer or a Hall-effect device. You then use a microcontroller to monitor the phase and switch the capacitors in or out to minimize this phase difference. Solid-state relays can be used to switch each capacitor across the power line.