<p>The method for forming the wiring structure is provided to improve the reliability of the semiconductor device by applying voltage to actives through the contact which can be changed according to the location of the silicon fence. The method for forming the wiring structure comprises as follows. A step is for forming the first active(104a) having the first side wall having the positive slope and the second active(104b) arranged in the first direction which is depart from first active in the semiconductor substrate. A step is for forming the element isolation film(106) by burying the gap between the first and second actives on the semiconductor substrate. The step is for forming the mask pattern having the opening which is extended in the first direction on the first active, and second actives and element isolation film and exposes the first lateral wall. A step is for forming the groove in the first direction by etching the element isolation film using the mask pattern as the etching mask and for changing the fence(44b) having a higher height than the groove. A step is for forming the wiring(110) which buries the groove. A step is for forming on the wiring the contact(112) to locate in the direction of the second active.</p>