This is what i have so far. I haven't been able to figure out how to subtract the cylinder from the intersected piece.
union(1){ intersection(){ cylinder(h=2,d=5, center=true); cube([7,2,2], center=true); }} difference(){ cylinder(h=3,d=1,center=true); union(1); }
This is the solution to my problem. If it helps anyone can use as you want since i answered my own question.