How do I set up a 2 in 1 out extruder system in Marlin
You need to change the amount of extruders in the Configuration.h:
Set 2 extruders by defining:
// @section extruder

// This defines the number of extruders
// :[0, 1, 2, 3, 4, 5, 6, 7, 8]
#define EXTRUDERS 2

Define that you have a single nozzle:
// For Cyclops or any &quot;multi-extruder&quot; that shares a single nozzle.
#define SINGLENOZZLE

If you want to switch filament during a print, you need to write tool loading and unloading (tool changing) scripts for the slicer you use, also do print a filament prime/wipe tower that is large enough to purge the filament to prevent color mixing.
In case color mixing, you do not set the amount of extruders, instead you need to define that mixing is being used:
#define MIXING_EXTRUDER

furthermore, the amount of mixing stepper need to be defined:
#define MIXING_STEPPERS 2