First, you need to determine if both of those lines are waste lines, or if one is a vent.
If both are waste lines, you will need to cut in a tee off the 3", and then vent between the stack and the p-trap. The p-trap will have a standpipe above it.
If you can't find a vent to connect to, you will have to use an AAV as the vent.
The top of the standpipe can be about 40" off the floor.