I have one limit switch.
Motor rotate clockwise 360 degrees, reach the switch and stops for x seconds.
Then rotate counterclockwise same 360 degrees, reach the switch and stops for y seconds.
You have not told us what type of motor you have or whether you have a motor driver board. You cannot connect a motor directly to an Arduino.
If you want someone to write a program for you please ask in the Gigs and Collaborations section of the Forum and be prepared to pay.
If you want to learn to program yourself the examples that come with the Arduino IDE are a good place to start. There are also many online tutorials. Also see the Useful Links Thread.
Post a diagram of your machine so we can understand how the limit switch is placed and how you propose to use the same switch for 2 directions (which is what I think you are trying to do).
Especially, show us how the limit switch is activated by the motor mechanism. Is it pressed by an arm attached to the motor? Is it activated by a cam attached to the motor? Is it a standard micro switch? Or is a leaf switch that is pressed by something attached to the motor?