The normal way to do this is to run the drain line over from the back of the house to the 90 degree and then all the way up to the roof. Then about 2 foot up from the floor the "p" trap ties into the line with a sanitary "t". Note: above the place where the "p" trap ties in can bend left or right, whatever it needs to do to bypass obstructions but it MUST always angle up so that if you poured water in from the roof it would drain down to the sewer and not puddle.