Magic email transformation! Or: help the NSA extract your metadata from your email address
Java 8, 254 240 236 bytes

(a,b,c)-&gt;{String A[]=a.split(&quot;@&quot;),C[]=c.split(&quot;@&quot;),x=&quot;&quot;;for(String p:C[0].split(&quot;\\.&quot;))x+=(p.charAt(0)+&quot;&quot;).toUpperCase()+p.substring(1)+&quot; &quot;;return a.equals(b)?c:A[0].equals(b)?C[0]:A[1].split(&quot;\\.&quot;)[0].equals(b)?C[1].split(&quot;\\.&quot;)[0]:x;}

-4 bytes thanks to @LukeStevens.
Explanation:
Try it here.
(a,b,c)-&gt;{                  // Method with three String parameters and String return-type
  String A[]=a.split(&quot;@&quot;),  //  Split `a` by &quot;@&quot; into two parts
         C[]=c.split(&quot;@&quot;),  //  Split `c` by &quot;@&quot; into two parts
         x=&quot;&quot;;              //  Temp-String
  for(String p:C[0].split(&quot;\\.&quot;)) 
                            //  Loop over the first part of `c`, split by dots
    x+=                     //   Append String `x` with:
       (p.charAt(0)+&quot;&quot;).toUpperCase()
                            //    The first character as uppercase
       +p.substring(1)      //    + the rest of the String
       +&quot; &quot;;                //    + a space
                            //  End of loop (implicit / single-line body)
  return a.equals(b)?       //  If input `a` and `b` are exactly the same:
    c                       //   Return `c`
   :A[0].equals(b)?         //  Else-if the first part of `a` equals `b`:
    C[0]                    //   Return the first part of `c`
   :A[1].split(&quot;\\.)[0].equals(b)?
                            //  Else-if the domain of `a` equals `b`
    C[1].split(&quot;\\.)[0]     //   Return the domain of `c`
   :                        //  Else:
    x;                      //   Return String `x`
}                           // End of method