How to model a multipe output loop

How to model a loop in BPMN Camunda that in the first loop goes to event A and when the event has run through it goes back to the Loop and then goes to event B. or can I solve that better without a loop just Gateways or someting?

Both events ar a whole Process but not a subprocess.

Howdy, I am not completely clear on your issue at hand but let me try to provide a solution for my assumption. Feel free to correct it though.

Assumption: You might (or might not) receive an Event A and if you do, you always want to follow it up by wating for an Event B.

Preface: You dont ever need a loop for this case. Event A and B are sequential - so model them as such. Where it gets a bit more tricky is with the optionality of Event A.

Solution 1: Use an Event based gateway and model Event A and B sequentially as 1 path after the gateway and another path as to the breakout condition (when will you stop waiting for Event A - this could be a timer event or a conditional event). This solution is pretty simple and readable but requires you to know this “breakout” condition and you need to have a token (the current state of the process instance) on the event-based gateway whenever you anticipate the event.

Solution 2: Requires some more BPMN knowledge but is much more flexible than the previous one and it involves using an event sub-process with a start Event A, followed by an intermediate event B, followed by whatever you want to do afterwards. This could be either interrupting or not - depending on your requirements.

Both topics are available as videos with exercises in the Camunda Academy, so I can recommend you that but am also happy to expand on something if you need more information.