Disclaimer: I'm from the US and don't claim to know German or Turkish law. So let me discuss some general principles here, but details may well be different in Germany and Turkey.
You're mixing together three very different things: trademark, copyright, and patent.
Copyright protects the expression of an idea, in this case, the exact computer code, images, etc. If you didn't copy his code, the chance that you would coincidentally write identical code is remote. The fact that you both have a line of code that says x=x+1
wouldn't give him any grounds for a lawsuit. He'd have to show substantial portions of the code were identical. If you didn't deliberately copy his code, this isn't going to happen. Barring some extraordinary and unbelievable coincidence, you can't violate copyright accidentally.
Trademark protects names and symbols used to identify a company or a product. If you decided to call your software company "Microsoft", then that other Microsoft could sue you for trademark infringement. Likewise if you copied somebody else's logo or other distinctive graphics. This is very different from copyright. It is quite possible to violate someone's trademark accidentally. Especially if he gave his company or product a rather generic name. Like if someone called his product, say, "Password Manager", someone else might make a product with the same name without ever having heard of the original. Ditto if he has some simple logo or other graphics. If you did accidentally duplicate a name or graphic elements, well, in the US a court would likely order you to change your name or graphics and that would be the end of it, unless you refused, in which case you'd end up in court. US Courts have ruled that very generic names have limited trademark protection. An example I saw recently was "Main Street Auto Repair". A court said that the owner of that name could prevent someone else from opening a shop in the same town with the same name, but he couldn't sue someone in another town who happened to use the same name. This is why, by the way, companies often use made-up words for their product names. In your case, this should be a trivial issue. If he is claiming trademark to the look of the main menu screen, just change the colors or move some buttons around. If it actually went to court, you should be able to argue that the similarity was accidental and when you were informed you promptly changed it, and that should be the end of it. Depending, I guess, on how hard-nosed the judge is, etc.
Patents are different still. A patent gives the owner the exclusive right to use an invention or process for a specified period of time. It doesn't matter if you invented the same thing entirely independently. Whoever filed the patent first has exclusive rights. There have been cases where an inventor lost out to someone with a similar invention because he submitted his patent application one day later. If this other person has patents that you are infringing, you are pretty much out of luck.