You are never going to be able to do it that way, because the voltages on the potentiometer pins of a digital pot chip are limited to being in between the chip's supply rails, and you'll have great difficulty finding any pot chips that can handle +/-10V on its pot pins let alone hundreds of volts.
Instead you need a circuit to detect the zero crossing of the mains waveform + a variable digital delay circuit (often implemented as code in a MCU) to provide a delayed firing pulse to the TRIAC, to let through a variable 'chunk' of each mains half cycle.
Also note that the zero crossing detection circuit and the TRIAC gate control signal must be treated as mains live, so it is unsafe to connect them to an Arduino, unless you either provide optical or pulse transformer isolatation, or treat the whole Arduino board, its PSU, sensors, and wiring as mains live.
Experimenting with direct mains powered TRIAC dimmers is *NOT* something that novices should be doing due to the high voltages and potentially high currents involved. If you are trying to teach yourself about digitally controlled dimmers, its a lot safer to work with 24VAC from a transformer and 24V truck bulbs.